/* Component Library - Enterprise Edition */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.25rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:focus {
    box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 4px var(--primary);
}

.btn-outline {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--bg-page);
    color: var(--text-primary);
    border-color: #d1d5db;
}

/* Cards & Panels */
.card,
.glass-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Headings inside a card context must use --text-card.
   style.css sets h1-h4 { color: var(--text-primary) } globally which
   beats inheritance, so we need an explicit override here. */
.domain-card h1,
.domain-card h2,
.domain-card h3,
.domain-card h4,
.domain-card-compact h1,
.domain-card-compact h2,
.domain-card-compact h3,
.domain-card-compact h4,
.dns-editor h1,
.dns-editor h2,
.dns-editor h3,
.dns-editor h4 {
    color: var(--text-card);
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5rem;
    color: var(--input-text, #1a1a1a);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
    /* Critical: Include padding in width calculation */
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background-color: var(--error-bg);
    color: var(--error);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}


/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background-color: var(--error-bg);
    color: var(--error);
}

/* ─── Header / Nav
   Always dark (matches the dark page), with its own text colors so a light
   --bg-card or --text-primary from branding can never make it unreadable. ── */
:root {
    --header-bg: #0b1020;
    --header-text: #f8fafc;
    --header-muted: #cbd5e1;
    --header-border: rgba(255, 255, 255, 0.08);
}
.header {
    background-color: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid var(--header-border);
    padding: 0.75rem 0;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.header-brand { font-size: 1.5rem; font-weight: 700; color: var(--header-text); text-decoration: none; display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.header-brand-accent { color: var(--primary); }
/* The brand is a link: keep it from picking up the site's generic link colors and underline in any state. */
.header a.header-brand, .header a.header-brand:link, .header a.header-brand:visited, .header a.header-brand:hover, .header a.header-brand:focus, .header a.header-brand:active { color: var(--header-text) !important; text-decoration: none !important; }
.header a.header-brand .header-brand-accent { color: var(--primary) !important; text-decoration: none !important; }
.header-nav { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.header .nav-link { font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--header-muted); transition: color 0.2s; }
.header .nav-link:hover, .header .nav-link:focus-visible { color: var(--header-text); }
.header .btn-outline { background-color: transparent; border: 1px solid rgba(255, 255, 255, 0.25); color: var(--header-text); }
.header .btn-outline:hover { background-color: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); color: var(--header-text); }
.header .header-logout { border-color: #f87171; color: #fca5a5; }
.header .header-logout:hover { background-color: rgba(248, 113, 113, 0.12); color: #fecaca; }
@media (max-width: 560px) { .header-nav { gap: 0.9rem; } .header-brand { font-size: 1.3rem; } }

/* ─── Modal Overlay ─────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}