/* ============================================================
   AR Experience Panel — Flip7 Design System
   Font: YekanBakh | RTL | Mobile-first responsive
   ============================================================ */

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/YekanBakh.woff') format('woff');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* ── Flip7 Colors ── */
    --teal:         #2BA8A2;
    --teal-light:   #3CC4BD;
    --teal-dark:    #1E8C86;
    --teal-bg:      #E8F6F5;
    --gold:         #FFD23F;
    --gold-light:   #FFE47A;
    --gold-dark:    #E6B800;
    --coral:        #EF6C4A;
    --coral-light:  #FF8A6A;
    --coral-dark:   #D45233;
    --cream:        #FFF8E7;
    --sky:          #5DADE2;
    --surface:      #EFF8F7;
    --card:         #FFFFFF;
    --success:      #27AE60;
    --error:        #E74C3C;
    --text-dark:    #1a3a38;
    --text-body:    #2d5a56;
    --text-muted:   #6b9e9a;
    --border:       #c8e8e6;

    /* ── Shadows (Flip7 Glow System) ── */
    --shadow-sm:          0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:          0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg:          0 8px 32px rgba(0,0,0,0.16);
    --shadow-card:        0 4px 20px rgba(43,168,162,0.10);
    --shadow-teal-glow:   0 4px 20px rgba(43,168,162,0.30);
    --shadow-gold-glow:   0 4px 20px rgba(255,210,63,0.40);
    --shadow-coral-glow:  0 4px 20px rgba(239,108,74,0.35);
    --shadow-sky-glow:    0 4px 16px rgba(93,173,226,0.30);
    --shadow-focus:       0 0 0 4px rgba(43,168,162,0.15);

    /* ── Radius ── */
    --r-sm:    8px;
    --r-md:    16px;
    --r-lg:    24px;
    --r-xl:    32px;
    --r-round: 999px;

    /* ── Spacing ── */
    --sp-xs: 8px;
    --sp-sm: 16px;
    --sp-md: 24px;
    --sp-lg: 32px;
    --sp-xl: 48px;

    --sidebar-w: 260px;
}

/* ── Dark Mode Variables ── */
:root {
    --dm-bg:        #0d1f1e;
    --dm-surface:   #0f2a28;
    --dm-card:      #132e2c;
    --dm-card-alt:  #1a3a37;
    --dm-border:    #1f4a47;
    --dm-text:      #e0f5f4;
    --dm-text-body: #a8d8d5;
    --dm-text-muted:#5a9e9a;
    --dm-sidebar:   linear-gradient(180deg, #071514 0%, #0d2220 100%);
    --dm-input-bg:  #0d2220;
}

body.dark-mode,
html[data-dark="1"] body {
    --surface:    var(--dm-bg);
    --card:       var(--dm-card);
    --teal-bg:    var(--dm-surface);
    --border:     var(--dm-border);
    --cream:      var(--dm-input-bg);
    --text-dark:  var(--dm-text);
    --text-body:  var(--dm-text-body);
    --text-muted: var(--dm-text-muted);
}

html { font-size: 16px; }

body {
    font-family: 'YekanBakh', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    background: var(--surface);
    color: var(--text-dark);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ── Auth Page ─────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--sp-md);
    background: linear-gradient(145deg, var(--teal-dark) 0%, var(--teal) 50%, #1a7a75 100%);
}

.auth-container { width: 100%; max-width: 440px; }

.auth-box {
    background: var(--card);
    border-radius: var(--r-xl);
    padding: var(--sp-xl) var(--sp-lg);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(43,168,162,0.25);
    border: 2px solid rgba(255,255,255,0.3);
}

.auth-logo { text-align: center; margin-bottom: var(--sp-lg); }

.auth-logo .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-sm);
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--teal-dark);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-md); }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-body);
    margin-bottom: var(--sp-xs);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    background: var(--cream);
    border: 2px solid var(--border);
    color: var(--text-dark);
    padding: 14px var(--sp-md);
    border-radius: var(--r-md);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    direction: rtl;
    outline: none;
}

.form-group input:focus {
    border-color: var(--teal);
    box-shadow: var(--shadow-focus);
    background: #fff;
}

.password-field { position: relative; }
.password-field input { padding-left: 48px; }

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--r-sm);
    transition: color 0.2s;
}
.toggle-password:hover { color: var(--teal); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
    padding: 14px var(--sp-lg);
    border-radius: var(--r-round);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s, opacity 0.2s;
    min-height: 48px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.95) !important; }

/* Primary — Gold CTA */
.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--teal-dark);
    box-shadow: var(--shadow-gold-glow);
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 60%);
    border-radius: inherit;
    pointer-events: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(255,210,63,0.55);
}

/* Outline */
.btn-outline {
    background: transparent;
    border: 2px solid var(--teal);
    color: var(--teal-dark);
}
.btn-outline:hover {
    background: var(--teal-bg);
    box-shadow: var(--shadow-teal-glow);
    transform: translateY(-1px);
}

/* Danger */
.btn-danger {
    background: linear-gradient(135deg, var(--coral-light), var(--coral));
    color: white;
    box-shadow: 0 2px 12px rgba(239,108,74,0.25);
}
.btn-danger:hover {
    box-shadow: var(--shadow-coral-glow);
    transform: translateY(-1px);
}

.btn-block { width: 100%; padding: 16px; font-size: 16px; }
.btn-sm { padding: 8px var(--sp-md); font-size: 13px; min-height: 36px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--sp-md);
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}
.alert-error {
    background: rgba(231,76,60,0.1);
    color: #c0392b;
    border: 1.5px solid rgba(231,76,60,0.25);
}
.alert-success {
    background: rgba(39,174,96,0.1);
    color: #1e8449;
    border: 1.5px solid rgba(39,174,96,0.25);
}

/* ── Dashboard Layout ───────────────────────────────────────── */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--teal-dark) 0%, var(--teal) 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 200;
    box-shadow: -4px 0 24px rgba(30,140,134,0.25);
    transition: transform 0.3s ease, background 0.3s ease;
}

body.dark-mode .sidebar,
html[data-dark="1"] body .sidebar {
    background: var(--dm-sidebar);
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-lg) var(--sp-md);
    font-size: 20px;
    font-weight: 800;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    letter-spacing: 1px;
}
.sidebar-logo span:first-child { font-size: 28px; }

/* ── Logo image (جایگزین emoji) ── */
.sidebar-logo-img {
    width: 37px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    /* لوگو رنگی با پس‌زمینه شفاف — روی sidebar تاریک خوب دیده می‌شه */
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.topbar-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.auth-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 4px 12px rgba(253,89,0,0.35));
}

/* ── Dark Mode Toggle Button ── */
.btn-theme {
    margin-right: auto;
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.btn-theme:hover {
    background: rgba(255,210,63,0.25);
    color: var(--gold);
    border-color: rgba(255,210,63,0.35);
    transform: scale(1.1);
}
.btn-theme:active { transform: scale(0.9); }
.btn-theme svg { width: 18px; height: 18px; display: block; }

.sidebar-nav { flex: 1; padding: var(--sp-sm) var(--sp-xs); }

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: 13px var(--sp-md);
    border-radius: var(--r-md);
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s;
}
.nav-item:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}
.nav-item.active {
    background: rgba(255,255,255,0.18);
    color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.nav-icon { font-size: 20px; flex-shrink: 0; }

.sidebar-footer {
    padding: var(--sp-md);
    border-top: 1px solid rgba(255,255,255,0.15);
}
.user-info {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-sm);
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 600;
}
.user-avatar { font-size: 24px; }

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
    padding: 10px;
    border-radius: var(--r-md);
    background: rgba(239,108,74,0.2);
    color: #ffd4c8;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
    border: 1px solid rgba(239,108,74,0.3);
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    text-align: center;
}
.btn-logout:hover { background: rgba(239,108,74,0.35); }

/* ── Mobile top bar ─────────────────────────────────────────── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: var(--teal-dark);
    z-index: 300;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-md);
    box-shadow: var(--shadow-md);
}
.mobile-topbar-title {
    color: white;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
}
.btn-menu {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    margin-right: var(--sidebar-w);
    flex: 1;
    padding: var(--sp-lg);
    overflow-y: auto;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-lg);
    flex-wrap: wrap;
    gap: var(--sp-sm);
}
.page-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--teal-dark);
    letter-spacing: 1px;
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
}

.stat-card {
    background: var(--card);
    border-radius: var(--r-lg);
    padding: var(--sp-lg) var(--sp-md);
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    box-shadow: var(--shadow-card);
    border: 1.5px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-teal-glow);
}
.stat-icon { font-size: 38px; flex-shrink: 0; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--teal-dark); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* ── Section Title ──────────────────────────────────────────── */
.section-title {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    font-size: 18px;
    font-weight: 800;
    color: var(--teal-dark);
    margin-bottom: var(--sp-md);
    padding-bottom: var(--sp-sm);
    border-bottom: 2px dashed var(--border);
}
.section-title .section-icon { font-size: 22px; }

/* ── Experiences Grid ───────────────────────────────────────── */
.experiences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: var(--sp-md);
}

.experience-card {
    background: var(--card);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1.5px solid var(--border);
    border-right: 6px solid var(--teal-light);
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.experience-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-teal-glow);
}

.card-thumbnail {
    position: relative;
    height: 175px;
    overflow: hidden;
    background: var(--teal-bg);
}
.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.experience-card:hover .card-thumbnail img { transform: scale(1.06); }

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: var(--r-round);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.badge-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(39,174,96,0.4);
}
.badge-warning {
    background: var(--gold);
    color: var(--teal-dark);
    box-shadow: 0 2px 8px rgba(255,210,63,0.4);
}

.card-body { padding: var(--sp-md); }
.card-title { font-size: 16px; font-weight: 800; margin-bottom: var(--sp-sm); color: var(--text-dark); }
.card-meta {
    display: flex;
    gap: var(--sp-md);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--sp-sm);
}

.share-link-box {
    display: flex;
    gap: 6px;
    margin-bottom: var(--sp-sm);
}
.share-link-box input {
    flex: 1;
    min-width: 0;
    background: var(--cream);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-family: monospace;
    direction: ltr;
    text-align: left;
}
.btn-copy {
    background: var(--teal-bg);
    border: 1.5px solid var(--border);
    color: var(--teal-dark);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-copy:hover {
    background: var(--teal);
    color: white;
    box-shadow: var(--shadow-teal-glow);
}
/* نمایش آیکون مناسب بر اساس Web Share */
.share-icon-native  { display: none; }
.share-icon-fallback{ display: block; }
.has-web-share .share-icon-native  { display: flex; align-items: center; }
.has-web-share .share-icon-fallback{ display: none; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px var(--sp-lg);
    color: var(--text-muted);
    background: var(--card);
    border-radius: var(--r-xl);
    border: 2px dashed var(--border);
}
.empty-icon { font-size: 64px; margin-bottom: var(--sp-md); }
.empty-state p { margin-bottom: var(--sp-lg); font-size: 16px; font-weight: 600; }

/* ── Create Page ────────────────────────────────────────────── */
.steps-indicator {
    display: flex;
    align-items: center;
    margin-bottom: var(--sp-lg);
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 0;
}
.step {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    opacity: 0.4;
    transition: opacity 0.3s;
    flex-shrink: 0;
}
.step.active, .step.done { opacity: 1; }
.step-num {
    width: 34px;
    height: 34px;
    border-radius: var(--r-round);
    background: var(--card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
}
.step.active .step-num {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
    box-shadow: var(--shadow-teal-glow);
}
.step.done .step-num {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.step-label { font-size: 13px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--teal-dark); }
.step.done .step-label { color: var(--success); }
.step-line { flex: 1; min-width: 20px; height: 2px; background: var(--border); margin: 0 var(--sp-xs); }

.create-form-box {
    background: var(--card);
    border-radius: var(--r-xl);
    padding: var(--sp-lg);
    max-width: 660px;
    box-shadow: var(--shadow-card);
    border: 1.5px solid var(--border);
}
.create-form-box h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--teal-dark);
    margin-bottom: 6px;
}
.hint-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: var(--sp-lg);
    line-height: 1.7;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-lg) var(--sp-md);
    text-align: center;
    margin-bottom: var(--sp-md);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
    background: var(--surface);
}
.upload-zone:hover, .upload-zone.has-file {
    border-color: var(--teal);
    background: var(--teal-bg);
    box-shadow: var(--shadow-focus);
}
.upload-icon { font-size: 42px; margin-bottom: var(--sp-xs); }
.upload-text strong { display: block; font-size: 15px; font-weight: 800; color: var(--text-dark); margin-bottom: 4px; }
.upload-text p { font-size: 12px; color: var(--text-muted); margin-bottom: var(--sp-sm); }

.file-preview {
    margin-top: var(--sp-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    flex-direction: column;
}
.file-preview img { max-height: 90px; border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.file-preview span { font-size: 12px; color: var(--success); font-weight: 700; }

/* ── Compile progress ───────────────────────────────────────── */
.compile-icon { font-size: 64px; margin-bottom: var(--sp-md); }
.text-center { text-align: center; }

.progress-bar-wrap {
    background: var(--teal-bg);
    border-radius: var(--r-round);
    height: 14px;
    overflow: hidden;
    margin: var(--sp-md) 0 var(--sp-xs);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 100%);
    border-radius: var(--r-round);
    width: 0%;
    transition: width 0.35s ease;
    box-shadow: 0 2px 8px rgba(43,168,162,0.4);
}
.progress-label { font-size: 28px; font-weight: 800; color: var(--teal-dark); margin-bottom: var(--sp-sm); }

/* ── Success step ───────────────────────────────────────────── */
.success-icon { font-size: 72px; margin-bottom: var(--sp-md); }
.share-box { display: flex; gap: var(--sp-sm); margin: var(--sp-md) 0; }
.share-box input {
    flex: 1;
    min-width: 0;
    background: var(--cream);
    border: 1.5px solid var(--border);
    color: var(--text-dark);
    padding: 13px var(--sp-md);
    border-radius: var(--r-md);
    font-size: 13px;
    font-family: monospace;
    direction: ltr;
    text-align: left;
}
.share-actions {
    display: flex;
    gap: var(--sp-sm);
    justify-content: center;
    margin: var(--sp-sm) 0;
    flex-wrap: wrap;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: var(--sp-lg);
    left: 50%;
    transform: translateX(-50%);
    background: var(--teal-dark);
    color: white;
    padding: 13px var(--sp-lg);
    border-radius: var(--r-round);
    font-size: 14px;
    font-weight: 700;
    z-index: 9999;
    box-shadow: var(--shadow-teal-glow);
    animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.9); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ── User Info Button (sidebar footer) ─────────────────────── */
.user-info-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: 10px var(--sp-sm);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-xs);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
}
.user-info-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.15);
    color: white;
}
.user-info-btn.active {
    background: rgba(255,210,63,0.15);
    border-color: rgba(255,210,63,0.3);
    color: white;
}
.user-avatar-wrap { font-size: 22px; flex-shrink: 0; }
.user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-settings-icon { font-size: 16px; flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s, transform 0.3s; }
.user-info-btn:hover .user-settings-icon { opacity: 1; transform: rotate(45deg); }

/* ── Settings Page ──────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--sp-lg);
    max-width: 900px;
}

.settings-card {
    background: var(--card);
    border-radius: var(--r-xl);
    padding: var(--sp-lg);
    box-shadow: var(--shadow-card);
    border: 1.5px solid var(--border);
    border-right: 6px solid var(--teal-light);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-md);
    border-bottom: 2px dashed var(--border);
}
.settings-card-icon { font-size: 40px; flex-shrink: 0; }
.settings-card-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--teal-dark);
    margin-bottom: 4px;
}
.settings-card-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--sp-md);
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    font-weight: 600;
}

/* ── QR Code Section ────────────────────────────────────────── */
.qr-section {
    margin: var(--sp-lg) 0 var(--sp-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-sm);
}

.qr-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.qr-label::before,
.qr-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    width: 40px;
}

.qr-container {
    background: white;
    border-radius: var(--r-lg);
    padding: var(--sp-md);
    box-shadow: var(--shadow-card);
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, transform 0.2s;
}
.qr-container:hover {
    box-shadow: var(--shadow-teal-glow);
    transform: translateY(-2px);
}
.qr-container canvas,
.qr-container img {
    display: block;
    border-radius: var(--r-sm);
}

body.dark-mode .qr-container,
html[data-dark="1"] body .qr-container {
    border-color: var(--dm-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ── Password strength bar ──────────────────────────────────── */
.password-strength-wrap {
    height: 6px;
    background: var(--teal-bg);
    border-radius: var(--r-round);
    overflow: hidden;
    margin-bottom: 6px;
}
.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: var(--r-round);
    transition: width 0.35s ease, background 0.35s ease;
}
.password-strength-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    min-height: 18px;
}

/* dark mode overrides for settings */
body.dark-mode .settings-card,
html[data-dark="1"] body .settings-card {
    background: var(--dm-card);
    border-color: var(--dm-border);
}
body.dark-mode .settings-card-header h3,
html[data-dark="1"] body .settings-card-header h3 { color: var(--teal-light); }
body.dark-mode .password-strength-wrap,
html[data-dark="1"] body .password-strength-wrap  { background: var(--dm-surface); }

/* ══════════════════════════════════════════════════════════════
   DARK MODE — Component overrides
   ══════════════════════════════════════════════════════════════ */

body.dark-mode .auth-box {
    background: var(--dm-card);
    border-color: var(--dm-border);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0,0,0,0.5);
}
body.dark-mode .auth-page {
    background: linear-gradient(145deg, #071514 0%, #0d2220 50%, #071a19 100%);
}
body.dark-mode .form-group input {
    background: var(--dm-input-bg);
    border-color: var(--dm-border);
    color: var(--dm-text);
}
body.dark-mode .form-group input:focus {
    border-color: var(--teal-light);
    background: #0f2a28;
}
body.dark-mode .stat-card,
body.dark-mode .experience-card,
body.dark-mode .create-form-box,
body.dark-mode .empty-state {
    background: var(--dm-card);
    border-color: var(--dm-border);
}
body.dark-mode .experience-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
body.dark-mode .card-title { color: var(--dm-text); }
body.dark-mode .share-link-box input,
body.dark-mode .share-box input {
    background: var(--dm-input-bg);
    border-color: var(--dm-border);
    color: var(--dm-text-body);
}
body.dark-mode .btn-copy {
    background: var(--dm-surface);
    border-color: var(--dm-border);
    color: var(--dm-text-body);
}
body.dark-mode .upload-zone {
    background: var(--dm-surface);
    border-color: var(--dm-border);
}
body.dark-mode .upload-zone:hover,
body.dark-mode .upload-zone.has-file {
    background: #0f2a28;
    border-color: var(--teal-light);
}
body.dark-mode .upload-text strong { color: var(--dm-text); }
body.dark-mode .progress-bar-wrap  { background: var(--dm-surface); }
body.dark-mode .btn-outline {
    border-color: var(--dm-border);
    color: var(--dm-text-body);
}
body.dark-mode .btn-outline:hover {
    background: rgba(43,168,162,0.12);
    border-color: var(--teal-light);
    color: var(--teal-light);
}
body.dark-mode .mobile-topbar { background: #071514; }
body.dark-mode .page-header h2 { color: var(--teal-light); }
body.dark-mode .section-title  { color: var(--teal-light); border-color: var(--dm-border); }
body.dark-mode .toast {
    background: var(--dm-card-alt);
    border: 1px solid var(--dm-border);
    color: var(--dm-text);
    box-shadow: var(--shadow-teal-glow);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ══════════════════════════════════════════════════════════════ */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
    :root { --sidebar-w: 240px; }
    .main-content { padding: var(--sp-md); }
    .experiences-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* Mobile (≤ 680px) */
@media (max-width: 680px) {
    .mobile-topbar { display: flex; }

    .sidebar {
        transform: translateX(100%);
        width: 280px;
        top: 0;
    }
    .sidebar.open { transform: translateX(0); }

    .main-content {
        margin-right: 0;
        padding: var(--sp-sm);
        padding-top: calc(60px + var(--sp-sm)); /* topbar height */
    }

    .page-header h2 { font-size: 20px; }
    .page-header { margin-bottom: var(--sp-md); }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }
    .stat-card { padding: var(--sp-md) var(--sp-sm); }
    .stat-value { font-size: 24px; }
    .stat-icon { font-size: 28px; }

    .experiences-grid { grid-template-columns: 1fr; }

    .create-form-box { padding: var(--sp-md); }
    .create-form-box h3 { font-size: 17px; }

    .steps-indicator { gap: 0; }
    .step-label { display: none; }
    .step-num { width: 30px; height: 30px; font-size: 13px; }

    .auth-box { padding: var(--sp-lg) var(--sp-md); }
    .auth-logo h1 { font-size: 22px; }

    .share-box { flex-direction: column; }
    .share-box input { font-size: 12px; }

    .btn-block { font-size: 15px; }

    .card-thumbnail { height: 150px; }

    .upload-zone { padding: var(--sp-md); }

    .toast { width: calc(100% - 32px); text-align: center; }

    .settings-grid { grid-template-columns: 1fr; }
}

/* Small mobile (≤ 400px) */
@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .card-actions { gap: 6px; }
    .card-actions .btn-sm { font-size: 12px; padding: 7px var(--sp-sm); }
}
