/* ============================================================
   GILGAMEZ v4.0.0 — ENTERPRISE ACCOUNT CENTER STYLES
   Theme-Adaptive, Responsive & Mobile-Ready CSS Architecture
   ============================================================ */

.account-center-layout {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* ── 1. Account Hero Header Card ── */
.account-hero-card {
    background: var(--card-bg, rgba(22, 24, 34, 0.85));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.account-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color, #ddaf31), #38bdf8, #818cf8);
}

.account-hero-profile {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.account-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.account-avatar-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color, #ddaf31);
    box-shadow: 0 0 24px rgba(221, 175, 49, 0.25);
    display: block;
}

.account-avatar-overlay {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
}

.account-hero-details {
    min-width: 0;
}

.account-hero-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.account-hero-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    letter-spacing: -0.02em;
    margin: 0;
}

.account-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-role-badge.role-owner {
    background: linear-gradient(135deg, rgba(221, 175, 49, 0.25), rgba(245, 158, 11, 0.15));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.account-role-badge.role-superadmin {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.account-role-badge.role-admin {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.account-hero-identifiers {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
}

.account-id-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    color: #38bdf8;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-id-chip:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

.account-hero-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.account-stat-pill {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    padding: 10px 18px;
    text-align: right;
    min-width: 140px;
}

.account-stat-pill-label {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.account-stat-pill-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #34d399;
    font-family: monospace;
}

/* ── 2. Adaptive Navigation Pill Tabs ── */
.account-tabs-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.account-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary, #94a3b8);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.account-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #f8fafc);
}

.account-tab-btn.active {
    background: var(--primary-color, #ddaf31);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(221, 175, 49, 0.3);
}

.account-tab-badge {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

.account-tab-btn.active .account-tab-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #000;
}

/* ── 3. Tab Panes ── */
.account-tab-pane {
    display: none;
    animation: accountFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.account-tab-pane.active {
    display: block;
}

@keyframes accountFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── 4. Card Surfaces ── */
.account-card {
    background: var(--card-bg, rgba(22, 24, 34, 0.85));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 18px;
    padding: 26px 30px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.account-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(221, 175, 49, 0.12);
    border: 1px solid rgba(221, 175, 49, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color, #ddaf31);
}

.account-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 2px 0;
}

.account-card-subtitle {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    margin: 0;
}

/* ── 5. Responsive Form Grid ── */
.account-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.account-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-form-group.full-width {
    grid-column: 1 / -1;
}

.account-form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #cbd5e1);
}

.account-form-input,
.account-form-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary, #f8fafc);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.account-form-input:focus,
.account-form-select:focus {
    border-color: var(--primary-color, #ddaf31);
    box-shadow: 0 0 0 3px rgba(221, 175, 49, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.account-input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

.account-input-action-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 6px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.account-input-action-btn:hover {
    color: var(--text-primary, #f8fafc);
}

/* ── 6. Password Complexity Meter ── */
.password-strength-box {
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-criteria-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

.password-criteria-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-criteria-item.met {
    color: #34d399;
}

/* ── 7. Hardware Passkeys List & Cards ── */
.passkey-hero-banner {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.passkey-hero-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.passkey-hero-icon {
    font-size: 2.2rem;
}

.passkey-list-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.passkey-item-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s ease;
}

.passkey-item-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

.passkey-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.passkey-icon-bubble {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.passkey-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 3px 0;
}

.passkey-item-meta {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.passkey-badge-pill {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
}

/* ── 8. TOTP Multi-Factor Authentication Components ── */
.totp-status-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    margin-bottom: 24px;
}

.totp-status-box.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.6));
    border-color: rgba(16, 185, 129, 0.3);
}

.totp-wizard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

.totp-qr-container {
    background: #fff;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-height: 240px;
}

.totp-qr-container img,
.totp-qr-container svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.totp-secret-key-display {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 13px;
    color: #38bdf8;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.totp-code-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.totp-digit-input {
    width: 100%;
    max-width: 240px;
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--primary-color, #ddaf31);
    color: var(--primary-color, #ddaf31);
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.backup-code-pill {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #f8fafc;
    letter-spacing: 0.08em;
}

/* ── 9. Multi-Device Sessions Grid ── */
.sessions-list-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.session-device-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    transition: all 0.2s ease;
}

.session-device-card.is-current {
    border-color: rgba(56, 189, 248, 0.4);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.6));
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.12);
}

.session-device-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.session-device-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.session-device-card.is-current .session-device-icon {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.session-device-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.session-device-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0;
}

.session-current-badge {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.session-device-meta {
    font-size: 12.5px;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── 10. Security Activity Audit Ledger ── */
.audit-ledger-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audit-event-row {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: background 0.2s ease;
}

.audit-event-row:hover {
    background: rgba(15, 23, 42, 0.75);
}

.audit-event-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.audit-severity-indicator {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.audit-severity-indicator.severity-info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.audit-severity-indicator.severity-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.audit-severity-indicator.severity-critical {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.audit-event-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 2px 0;
    text-transform: capitalize;
}

.audit-event-meta {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── 11. Buttons & Utility Styling ── */
.btn-account-primary {
    background: var(--primary-color, #ddaf31);
    color: #000;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 13.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-account-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(221, 175, 49, 0.3);
    transform: translateY(-1px);
}

.btn-account-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    color: var(--text-primary, #f8fafc);
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-account-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-account-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-account-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
}

/* ── 12. 5-Tier Responsive Engine ── */
@media (max-width: 992px) {
    .account-hero-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
    }
    .account-hero-stats {
        width: 100%;
        justify-content: flex-start;
    }
    .account-form-grid {
        grid-template-columns: 1fr;
    }
    .totp-wizard-grid {
        grid-template-columns: 1fr;
    }
    .backup-codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .account-hero-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    .account-hero-name-row {
        justify-content: center;
    }
    .account-hero-identifiers {
        justify-content: center;
    }
    .account-card {
        padding: 20px 16px;
    }
    .passkey-item-card,
    .session-device-card,
    .audit-event-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .passkey-item-actions,
    .session-device-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    .totp-status-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .backup-codes-grid {
        grid-template-columns: 1fr;
    }
}
