/**
 * Account page styles - Mon Compte
 * Spotify/Apple-inspired with Yaqinly gold accents
 */

.acc-page {
    max-width: 880px;
    margin: 32px auto 100px;
    padding: 0 20px;
    color: var(--text, #fff);
    font-family: var(--font-body, system-ui, sans-serif);
}

/* ───── Logged-out hero ───── */
.acc-hero {
    text-align: center;
    padding: 56px 24px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(8px);
}

.acc-hero-icon {
    display: inline-flex;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #b8941d);
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.25);
}

.acc-hero-icon .material-icons-round {
    font-size: 44px;
    color: #1a1612;
}

.acc-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.acc-hero-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.5;
    max-width: 480px;
    margin: 0 auto 28px;
}

.acc-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.acc-divider {
    margin: 24px 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    letter-spacing: 2px;
}

.acc-magic {
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
}

.acc-magic h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin: 0 0 4px;
    color: #d4af37;
    justify-content: center;
}

.acc-magic-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin: 0 0 16px;
}

.acc-magic-form {
    display: flex;
    gap: 8px;
}

.acc-magic-form input[type="email"] {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
}

.acc-magic-form input[type="email"]:focus {
    outline: 2px solid #d4af37;
    border-color: transparent;
}

/* ───── Logged-in header ───── */
.acc-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
}

.acc-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(212, 175, 55, 0.4);
    overflow: hidden;
    flex-shrink: 0;
}

.acc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.acc-avatar .material-icons-round {
    font-size: 48px;
    color: #d4af37;
}

.acc-identity {
    flex: 1;
    min-width: 0;
}

.acc-identity h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acc-email {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin: 0 0 2px;
}

.acc-since {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin: 0;
}

/* ───── Tabs ───── */
.acc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.acc-tabs::-webkit-scrollbar {
    display: none;
}

.acc-tab {
    flex: 1;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.acc-tab .material-icons-round {
    font-size: 18px;
}

.acc-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.acc-tab.is-active {
    background: linear-gradient(135deg, #d4af37, #b8941d);
    color: #1a1612;
    font-weight: 600;
}

/* ───── Panels ───── */
.acc-panel {
    display: none;
    padding: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    animation: accFadeIn 0.3s ease;
}

.acc-panel.is-active {
    display: block;
}

@keyframes accFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ───── Form ───── */
.acc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 520px;
}

.acc-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.acc-form label>span {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.acc-form label>span strong {
    color: #d4af37;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.acc-form input[type="text"],
.acc-form input[type="email"],
.acc-form input[type="url"],
.acc-form input[type="password"],
.acc-form select {
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s;
}

.acc-form input:focus,
.acc-form select:focus {
    outline: 2px solid #d4af37;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.08);
}

.acc-form input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.acc-form input[type="range"] {
    width: 100%;
    accent-color: #d4af37;
    height: 6px;
}

.acc-form input[type="checkbox"].acc-switch {
    appearance: none;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-end;
}

.acc-form input[type="checkbox"].acc-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.acc-form input[type="checkbox"].acc-switch:checked {
    background: #d4af37;
}

.acc-form input[type="checkbox"].acc-switch:checked::before {
    transform: translateX(20px);
}

/* ───── Buttons ───── */
.acc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: none;
}

.acc-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.acc-btn .material-icons-round {
    font-size: 18px;
}

.acc-btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941d);
    color: #1a1612;
    border-color: transparent;
    font-weight: 600;
}

.acc-btn-primary:hover {
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

.acc-btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
}

.acc-btn-warn {
    color: #ffb84d;
    border-color: rgba(255, 184, 77, 0.3);
}

.acc-btn-warn:hover {
    background: rgba(255, 184, 77, 0.08);
}

.acc-btn-danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

.acc-btn-danger:hover {
    background: rgba(255, 107, 107, 0.08);
}

/* ───── Misc ───── */
.acc-msg {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 4px;
}

.acc-msg.is-ok {
    background: rgba(46, 204, 113, 0.12);
    color: #4ee29c;
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.acc-msg.is-err {
    background: rgba(231, 76, 60, 0.12);
    color: #ff7c6e;
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.acc-msg:empty {
    display: none;
}

.acc-hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 32px 0;
}

.acc-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin: 0 0 16px;
    color: #d4af37;
}

.acc-help {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0 0 20px;
    font-style: italic;
}

.acc-data-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 14px;
}

.acc-data-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin: 0 0 8px;
}

.acc-data-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin: 0 0 12px;
    line-height: 1.5;
}

.acc-data-card.acc-danger {
    border-color: rgba(255, 107, 107, 0.25);
    background: rgba(255, 107, 107, 0.05);
}

.acc-data-card.acc-danger h3 {
    color: #ff6b6b;
}

/* ───── Light theme ───── */
body.theme-light .acc-hero,
body.theme-light .acc-header,
body.theme-light .acc-panel,
body.theme-light .acc-tabs,
body.theme-light .acc-data-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .acc-page {
    color: #1a1612;
}

body.theme-light .acc-hero h1,
body.theme-light .acc-identity h1 {
    color: #1a1612;
}

body.theme-light .acc-hero-text,
body.theme-light .acc-email,
body.theme-light .acc-tab,
body.theme-light .acc-form label,
body.theme-light .acc-data-card p {
    color: rgba(0, 0, 0, 0.65);
}

body.theme-light .acc-form input,
body.theme-light .acc-form select,
body.theme-light .acc-magic-form input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1612;
}

body.theme-light .acc-btn {
    color: #1a1612;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .acc-btn-primary {
    color: #1a1612;
}

/* ───── Mobile ───── */
@media (max-width: 640px) {
    .acc-page {
        margin: 16px auto 100px;
        padding: 0 12px;
    }

    .acc-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px;
    }

    .acc-identity h1 {
        font-size: 18px;
    }

    .acc-hero {
        padding: 36px 20px;
        border-radius: 18px;
    }

    .acc-hero h1 {
        font-size: 22px;
    }

    .acc-panel {
        padding: 18px;
        border-radius: 16px;
    }

    .acc-magic-form {
        flex-direction: column;
    }

    .acc-tab {
        font-size: 12px;
        padding: 9px 10px;
        min-width: 0;
    }

    .acc-tab .material-icons-round {
        font-size: 16px;
    }
}

[dir="rtl"] .acc-magic h3 {
    flex-direction: row-reverse;
}

[dir="rtl"] .acc-form input[type="checkbox"].acc-switch:checked::before {
    transform: translateX(-20px);
}

@media (prefers-reduced-motion: reduce) {

    .acc-panel,
    .acc-btn {
        animation: none;
        transition: none;
    }
}

/* ── spiritual dashboard cards (added by spiritprofile patch) ── */
.spirit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:8px}
.spirit-card{background:var(--surface,#fff);border:1px solid rgba(0,0,0,.08);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:8px;box-shadow:0 1px 4px rgba(0,0,0,.04)}
.spirit-card header{display:flex;align-items:center;gap:8px}
.spirit-card header h3{margin:0;font-size:15px;font-weight:600}
.spirit-card .spirit-line{margin:0;font-size:14px}
.spirit-card .spirit-meta{margin:0;font-size:12px;opacity:.7}
.spirit-card .spirit-bar{height:6px;border-radius:3px;background:rgba(0,0,0,.08);overflow:hidden}
.spirit-card .spirit-bar>span{display:block;height:100%;background:linear-gradient(90deg,#7e57c2,#26a69a)}
.spirit-card .acc-btn{align-self:flex-start;margin-top:auto}
.spirit-loading{align-items:center;text-align:center;opacity:.6}
@media (prefers-color-scheme: dark){.spirit-card{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.08)}}

/* Unified theme overrides (design-system) */
.acc-page {
    color: var(--text-primary);
}

.acc-hero,
.acc-header,
.acc-panel,
.acc-data-card,
.acc-tabs {
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.acc-hero-text,
.acc-email,
.acc-since,
.acc-help,
.acc-data-card p,
.acc-magic-hint {
    color: var(--text-muted);
}

.acc-form label,
.acc-tab {
    color: var(--text-secondary);
}

.acc-form input[type="text"],
.acc-form input[type="email"],
.acc-form input[type="url"],
.acc-form input[type="password"],
.acc-form select,
.acc-magic-form input[type="email"] {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.acc-form input:focus,
.acc-form select:focus,
.acc-magic-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-gold) 20%, transparent);
}

.acc-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.acc-btn:hover {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent-gold) 40%, var(--border-color));
}

.acc-subtitle,
.acc-magic h3,
.acc-data-card h3 {
    color: var(--accent-gold);
}

.acc-tab.is-active {
    background: linear-gradient(135deg, #e7cf8a, var(--accent-gold));
    color: #111;
}

.acc-msg.is-ok {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.acc-msg.is-err {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}