/* ============================================================
   COMMUNITY DIRECTORY · Design System
   Premium glassmorphism · Dark + light · Smooth motion
   ============================================================ */

:root[data-theme="dark"] {
    --bg-0:        #07080d;
    --bg-1:        #0c0e16;
    --bg-2:        #11141f;
    --surface:     rgba(20, 23, 35, 0.55);
    --surface-2:   rgba(28, 32, 47, 0.6);
    --border:      rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --fg:          #e9eaf0;
    --fg-muted:    #9aa0b4;
    --fg-dim:      #6b7088;
    --accent:      #7c9eff;
    --accent-2:    #c084fc;
    --accent-3:    #5eead4;
    --danger:      #ff6b6b;
    --warning:     #fbbf24;
    --success:     #34d399;
    --gradient-1:  linear-gradient(135deg, #7c9eff 0%, #c084fc 100%);
    --gradient-2:  linear-gradient(135deg, #5eead4 0%, #7c9eff 100%);
    --gradient-3:  linear-gradient(135deg, #fbbf24 0%, #ff6b6b 100%);
    --gradient-4:  linear-gradient(135deg, #c084fc 0%, #f472b6 100%);
    --shadow-md:   0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg:   0 24px 60px rgba(0, 0, 0, 0.5);
    --grain-opacity: 0.06;
}

:root[data-theme="light"] {
    --bg-0:        #f6f5f0;
    --bg-1:        #ecebe4;
    --bg-2:        #e3e2da;
    --surface:     rgba(255, 255, 255, 0.7);
    --surface-2:   rgba(255, 255, 255, 0.85);
    --border:      rgba(20, 20, 30, 0.08);
    --border-strong: rgba(20, 20, 30, 0.14);
    --fg:          #1a1c25;
    --fg-muted:    #5a5e72;
    --fg-dim:      #8b8fa3;
    --accent:      #4338ca;
    --accent-2:    #9333ea;
    --accent-3:    #0d9488;
    --danger:      #dc2626;
    --warning:     #d97706;
    --success:     #059669;
    --gradient-1:  linear-gradient(135deg, #4338ca 0%, #9333ea 100%);
    --gradient-2:  linear-gradient(135deg, #0d9488 0%, #4338ca 100%);
    --gradient-3:  linear-gradient(135deg, #d97706 0%, #dc2626 100%);
    --gradient-4:  linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    --shadow-md:   0 8px 30px rgba(40, 40, 60, 0.08);
    --shadow-lg:   0 24px 60px rgba(40, 40, 60, 0.12);
    --grain-opacity: 0.025;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-0);
    color: var(--fg);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    font-size: 15.5px;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

body { display: flex; flex-direction: column; }
.site-main { flex: 1; padding: 2rem 0 4rem; position: relative; z-index: 1; }

.serif { font-family: 'Instrument Serif', 'Times New Roman', serif; font-weight: 400; }
.italic { font-style: italic; }
.mono   { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85em; }

a { color: inherit; text-decoration: none; }
hr { border-color: var(--border); }

::selection { background: var(--accent); color: #fff; }

/* ============================================================
   Animated background
   ============================================================ */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: orb-float 28s ease-in-out infinite;
    will-change: transform;
}

.orb-1 {
    width: 520px; height: 520px;
    background: var(--gradient-1);
    top: -160px; left: -120px;
    animation-delay: 0s;
}
.orb-2 {
    width: 440px; height: 440px;
    background: var(--gradient-2);
    bottom: -180px; right: -100px;
    animation-delay: -10s;
}
.orb-3 {
    width: 380px; height: 380px;
    background: var(--gradient-4);
    top: 40%; right: 30%;
    animation-delay: -18s;
    opacity: 0.28;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(60px, -40px) scale(1.08); }
    66%      { transform: translate(-40px, 60px) scale(0.95); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    opacity: 0.35;
}

/* ============================================================
   Navbar / Footer
   ============================================================ */
.site-nav {
    background: transparent;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 1rem 0;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: var(--fg) !important;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px; height: 28px;
    background: var(--gradient-1);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    transform: rotate(45deg);
}
.brand-mark::before { transform: rotate(-45deg); display: block; }

.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--fg);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: all 0.25s;
    backdrop-filter: blur(10px);
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); }
:root[data-theme="dark"]  .theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark  { display: none; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--fg);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.25s;
    backdrop-filter: blur(10px);
    cursor: pointer;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.btn-ghost.btn-danger { color: var(--danger); }

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    position: relative; z-index: 1;
    color: var(--fg-muted);
}

/* ============================================================
   Containers / headers
   ============================================================ */
.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 1rem; }
.container-wide   { max-width: 1320px; margin: 0 auto; padding: 0 1rem; }

.page-header { margin-bottom: 2rem; }
.kicker {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    background: var(--surface);
    margin-bottom: 1rem;
}
.display-title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin: 0 0 0.75rem;
    color: var(--fg);
}
.lead-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--fg-muted);
    max-width: 60ch;
    margin: 0;
}

/* ============================================================
   Glass cards
   ============================================================ */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ============================================================
   Multi-step form
   ============================================================ */
.member-form { padding: 2rem; }

@media (min-width: 768px) { .member-form { padding: 2.5rem 3rem; } }

.form-progress {
    margin-bottom: 1.25rem;
}
.form-progress-track {
    height: 4px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}
.form-progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 100px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.form-progress-fill::after {
    content: "";
    position: absolute; top: 0; right: 0; bottom: 0; width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-30px); } 100% { transform: translateX(30px); } }

.form-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--fg-muted);
}

.form-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.form-steps::-webkit-scrollbar { display: none; }

.form-step {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}
.form-step span {
    display: inline-grid; place-items: center;
    width: 22px; height: 22px;
    background: var(--bg-2);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--fg-muted);
    flex-shrink: 0;
}
.form-step label { margin: 0; cursor: pointer; color: var(--fg-muted); font-weight: 500; }
.form-step.completed span { background: var(--success); color: #fff; }
.form-step.completed label { color: var(--fg); }
.form-step.active {
    background: var(--surface-2);
    border-color: var(--accent);
}
.form-step.active span { background: var(--gradient-1); color: #fff; }
.form-step.active label { color: var(--fg); font-weight: 600; }

/* Sections */
.form-section, .form-section-static { display: none; }
.form-section.active {
    display: block;
    animation: section-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-section-static { display: block; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.form-section-static:last-of-type { border-bottom: none; }

@keyframes section-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.section-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.section-icon {
    flex-shrink: 0;
    width: 46px; height: 46px;
    border-radius: 12px;
    background: var(--gradient-1);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 24px rgba(124, 158, 255, 0.3);
}
.section-head h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.015em;
}
.section-head p {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.92rem;
}

/* ============================================================
   Floating-label inputs
   ============================================================ */
.floating-field {
    position: relative;
    margin-bottom: 0.25rem;
}

.floating-field .form-control,
.floating-field .form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--fg);
    padding: 1.25rem 1rem 0.5rem;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.25s;
    height: auto;
    min-height: 56px;
}
.floating-field textarea.form-control { padding-top: 1.5rem; resize: vertical; }
.floating-field .form-control::placeholder { color: transparent; }
.floating-field .form-control:focus,
.floating-field .form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px rgba(124, 158, 255, 0.15);
}
.floating-field label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--fg-muted);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.2s;
    background: transparent;
    padding: 0 0.25rem;
}
.floating-field .form-control:focus + label,
.floating-field .form-control:not(:placeholder-shown) + label,
.floating-field .form-select + label,
.floating-field input[type="date"] + label {
    top: 0.3rem;
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.req { color: var(--accent-2); font-weight: 700; }
.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    padding-left: 0.25rem;
    animation: error-in 0.3s ease;
}
.field-hint {
    color: var(--fg-dim);
    font-size: 0.78rem;
    margin-top: 0.3rem;
    padding-left: 0.25rem;
}
@keyframes error-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.badge-private {
    display: inline-block;
    background: var(--gradient-3);
    color: #fff;
    font-size: 0.62rem;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    vertical-align: middle;
}

/* ============================================================
   Upload zone
   ============================================================ */
.upload-label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-zone {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    min-height: 180px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: translateY(-2px);
}
.upload-zone input[type=file] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    z-index: 2;
}
.upload-prompt {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.35rem;
    color: var(--fg-muted);
    pointer-events: none;
}
.upload-prompt i { font-size: 2rem; color: var(--accent); }
.upload-prompt strong { color: var(--fg); }
.upload-prompt small { font-size: 0.78rem; color: var(--fg-dim); }

/* "Photo already uploaded" state — appears after a form was re-rendered
   with errors and the server retained the prior upload via a token. */
.upload-saved {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.35rem;
    color: var(--fg-muted);
    pointer-events: none;
    z-index: 2;
}
.upload-saved i {
    font-size: 2.25rem;
    color: var(--success, #22c55e);
}
.upload-saved strong { color: var(--fg); font-size: 1.05rem; }
.upload-saved small { font-size: 0.78rem; color: var(--fg-dim); }
.upload-zone.has-token {
    border-color: var(--success, #22c55e);
    background: color-mix(in srgb, var(--success, #22c55e) 6%, var(--surface));
}

/* Inline hint label, e.g. "(optional)" or "(defaults to Nagpur)" */
.optional-hint {
    font-size: 0.72rem;
    color: var(--fg-dim);
    font-weight: 400;
    letter-spacing: 0.01em;
    margin-left: 0.25rem;
}
.upload-preview {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    min-height: 180px;
}
.upload-preview img {
    max-height: 200px;
    max-width: 200px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}
.btn-clear-photo {
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    display: grid; place-items: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: var(--shadow-md);
}

.current-photo-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.current-photo-wrap img {
    max-height: 200px;
    max-width: 200px;
    border-radius: 12px;
    object-fit: cover;
}

/* ============================================================
   Segmented control (radio buttons styled as tabs)
   ============================================================ */
.seg-control {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
}
.seg-option {
    flex: 1;
    position: relative;
    padding: 0.6rem 1.2rem;
    border-radius: 9px;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg-muted);
    transition: all 0.2s;
    margin: 0;
    white-space: nowrap;
}
.seg-option input { position: absolute; opacity: 0; pointer-events: none; }
.seg-option.active, .seg-option:has(input:checked) {
    background: var(--gradient-1);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(124, 158, 255, 0.3);
}

/* ============================================================
   Chip checkboxes
   ============================================================ */
.checks-label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    user-select: none;
}
.chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.chip input { accent-color: var(--accent); margin: 0; cursor: pointer; }
.chip:has(input:checked),
.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.chip:has(input:checked) input,
.chip.active input { accent-color: #fff; }

/* ============================================================
   Consent block
   ============================================================ */
.consent-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
}
.consent-block h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary-gradient {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.7rem;
    background: var(--gradient-1);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 8px 24px rgba(124, 158, 255, 0.25);
    text-decoration: none;
}
.btn-primary-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(124, 158, 255, 0.4);
}
.btn-primary-gradient:active { transform: translateY(0); }
.btn-primary-gradient:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--fg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}
.btn-secondary-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-secondary-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.form-nav {
    margin-top: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn-submit { margin-left: auto; }
.btn-loading { display: inline-flex; align-items: center; gap: 0.5rem; }
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Flash messages
   ============================================================ */
.flash-stack {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
}
.flash {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    background: var(--surface-2);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    font-size: 0.88rem;
    box-shadow: var(--shadow-lg);
    animation: flash-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.flash i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.flash-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--fg-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}
.flash-success { border-left: 3px solid var(--success); }
.flash-success i { color: var(--success); }
.flash-danger  { border-left: 3px solid var(--danger);  }
.flash-danger i { color: var(--danger); }
.flash-warning { border-left: 3px solid var(--warning); }
.flash-warning i { color: var(--warning); }
.flash-info    { border-left: 3px solid var(--accent);  }
.flash-info i  { color: var(--accent); }

@keyframes flash-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   Success page
   ============================================================ */
.success-card {
    padding: 3rem 2rem;
    text-align: center;
}

.success-anim { margin-bottom: 1.5rem; }
.check-svg {
    width: 84px; height: 84px;
}
.check-circle {
    fill: none;
    stroke: var(--success);
    stroke-width: 3;
    stroke-dasharray: 176;
    stroke-dashoffset: 176;
    animation: draw-circle 0.7s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.check-mark {
    stroke: var(--success);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: draw-mark 0.4s 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-mark   { to { stroke-dashoffset: 0; } }

.success-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
}
.meta-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.meta-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-muted); font-weight: 600; }
.meta-value { font-size: 0.95rem; font-weight: 500; }

.success-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }
.success-fineprint { color: var(--fg-dim); font-size: 0.85rem; margin-top: 1.5rem; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.pill-success { background: rgba(52, 211, 153, 0.15); color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.pill-muted   { background: var(--surface); color: var(--fg-muted); }

/* ============================================================
   Login card
   ============================================================ */
.login-card {
    padding: 3rem 2rem;
    max-width: 460px;
    margin: 4rem auto;
    text-align: center;
}
.login-card .display-title { font-size: 2.4rem; }
.login-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-1);
    color: #fff;
    display: grid; place-items: center;
    border-radius: 16px;
    font-size: 1.8rem;
    box-shadow: 0 12px 30px rgba(124, 158, 255, 0.3);
}
.login-form {
    text-align: left;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================================
   Admin Dashboard
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    color: #fff;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.bg-gradient-1 { background: var(--gradient-1); }
.bg-gradient-2 { background: var(--gradient-2); }
.bg-gradient-3 { background: var(--gradient-3); }
.bg-gradient-4 { background: var(--gradient-4); }

.stat-meta { display: flex; flex-direction: column; }
.stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-muted); font-weight: 600; }
.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }

.panel { padding: 1.5rem; height: 100%; }
.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fg);
}
.panel-title i { color: var(--accent); }

.bar-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.bar-list .empty { color: var(--fg-dim); text-align: center; padding: 1rem; font-style: italic; }
.bar-meta { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.3rem; }
.bar { height: 6px; background: var(--bg-2); border-radius: 100px; overflow: hidden; }
.bar span {
    display: block;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}
.recent-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.25s;
    color: inherit;
}
.recent-card:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.recent-card img {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.recent-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.recent-meta strong { font-size: 0.9rem; }
.recent-meta span { font-size: 0.78rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--fg-muted);
}
.empty-state i { font-size: 2.5rem; opacity: 0.5; display: block; margin-bottom: 0.5rem; }
.empty-state p { margin: 0; }

/* ============================================================
   Members table & filters
   ============================================================ */
.filters {
    padding: 1.25rem 1.5rem;
}
.filter-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.filters .form-control,
.filters .form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 10px;
}
.filters .form-control:focus,
.filters .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 158, 255, 0.15);
}
.search-wrap {
    position: relative;
}
.search-wrap i {
    position: absolute;
    left: 0.85rem; top: 50%;
    transform: translateY(-50%);
    color: var(--fg-muted);
    pointer-events: none;
}
.search-wrap .form-control { padding-left: 2.4rem; }
.filter-more {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    user-select: none;
}

.member-table-wrap { padding: 0; overflow-x: auto; }
.member-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.member-table th, .member-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.member-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    background: var(--surface);
    position: sticky; top: 0;
}
.member-table tbody tr:hover {
    background: var(--surface);
}
.member-table tbody tr:last-child td { border-bottom: none; }

.member-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.member-cell img {
    width: 42px; height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.member-cell strong { display: block; }
.member-cell small { font-size: 0.72rem; }

.contact-cell { display: flex; flex-direction: column; }
.contact-cell span { font-size: 0.88rem; }

.action-btn {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    transition: all 0.2s;
    margin-left: 0.25rem;
    cursor: pointer;
    text-decoration: none;
}
.action-btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.action-btn.action-danger:hover { border-color: var(--danger); color: var(--danger); }

.pagination-wrap {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-grid; place-items: center;
    min-width: 38px; height: 38px;
    padding: 0 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--fg);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}
.page-btn:hover:not(.disabled):not(.active) { background: var(--surface-2); border-color: var(--accent); }
.page-btn.active {
    background: var(--gradient-1);
    color: #fff;
    border-color: transparent;
}
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   Member detail
   ============================================================ */
.profile-hero {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}
@media (min-width: 768px) {
    .profile-hero { flex-direction: row; text-align: left; gap: 2rem; padding: 2.5rem; }
}
.profile-avatar {
    width: 140px; height: 140px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}
.profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
@media (min-width: 768px) {
    .profile-pills { justify-content: flex-start; }
}

.detail-list {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    gap: 0.6rem 1.5rem;
    align-items: baseline;
}
.detail-list dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    font-weight: 600;
}
.detail-list dd { margin: 0; font-size: 0.95rem; }

.detail-list-inline {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.detail-list-inline dt, .detail-list-inline dd { display: block; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: var(--gradient-1);
    color: #fff;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}
.tag-soft {
    background: var(--surface-2);
    color: var(--fg);
    border: 1px solid var(--border);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}
.link-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--fg);
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}
.link-card:hover { background: var(--surface-2); border-color: var(--accent); color: var(--fg); transform: translateY(-2px); }
.link-card i { color: var(--accent); font-size: 1.1rem; }

/* ============================================================
   Edit form (no wizard)
   ============================================================ */
.edit-form .form-section-static h2 { font-size: 1.3rem; }

/* ============================================================
   Mobile refinements
   ============================================================ */
@media (max-width: 768px) {
    .member-form { padding: 1.5rem 1.25rem; }
    .display-title { font-size: 2rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.4rem; }
    .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .seg-control { width: 100%; }
    .seg-option { padding: 0.6rem 0.75rem; }
    .form-nav { flex-direction: column; }
    .form-nav button, .form-nav a { width: 100%; justify-content: center; }
    .form-nav .btn-submit { margin-left: 0; }
    .profile-avatar { width: 110px; height: 110px; }
    .success-meta { gap: 1rem; padding: 1rem; }
    .detail-list { grid-template-columns: 1fr; gap: 0.3rem; }
    .detail-list dt { margin-top: 0.5rem; }
}

/* ============================================================
   Dropdown selects in dark mode (some browsers ignore CSS for native options)
   ============================================================ */
:root[data-theme="dark"] select option {
    background: var(--bg-1);
    color: var(--fg);
}
