/* ============================================================
   Photo Albums — global stylesheet
   ============================================================ */

:root {
    --bg:            #0c0d10;
    --bg-soft:       #15171c;
    --surface:       #1a1d24;
    --surface-2:     #232730;
    --line:          rgba(255,255,255,.08);
    --line-strong:   rgba(255,255,255,.16);
    --text:          #f4f4f7;
    --text-soft:     #b6b8c3;
    --text-mute:     #7f828f;
    --accent:        #f59e0b;     /* warm amber */
    --accent-2:      #ec4899;     /* pink */
    --accent-3:      #8b5cf6;     /* violet */
    --danger:        #f87171;
    --success:       #34d399;

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-2: 0 20px 60px rgba(0,0,0,.5);
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; letter-spacing: -0.01em; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
    padding: 1px 8px;
    border-radius: 6px;
    color: var(--text-soft);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary, .btn-secondary, .btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    font: 600 14px/1 'Inter', system-ui, sans-serif;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    user-select: none;
}
.btn-primary {
    color: #1a1208;
    background: linear-gradient(135deg, #fcd34d, #f59e0b 55%, #ec4899);
    box-shadow: 0 6px 24px rgba(245,158,11,.35), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(245,158,11,.5), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-primary.is-copied { background: linear-gradient(135deg, #6ee7b7, #34d399); color: #052e1a; }

.btn-secondary {
    color: var(--text);
    background: rgba(255,255,255,.06);
    border-color: var(--line-strong);
}
.btn-secondary:hover { background: rgba(255,255,255,.12); }

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--line);
    padding: 9px 14px;
    font-weight: 500;
}
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }

.btn-block { width: 100%; }

/* ============================================================
   Form fields & alerts
   ============================================================ */
.field { display: block; margin-bottom: 14px; }
.field > span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.field input {
    width: 100%;
    background: rgba(255,255,255,.04);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 13px 14px;
    font: 500 15px 'Inter', system-ui;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--text-mute); }
.field input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,.07);
    box-shadow: 0 0 0 4px rgba(245,158,11,.18);
}

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin: 8px 0 14px;
    border: 1px solid transparent;
}
.alert-error   { color: #fecaca; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.4); }
.alert-success { color: #bbf7d0; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.4); }

/* ============================================================
   Brand mark
   ============================================================ */
.brand-mark {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ec4899 55%, #8b5cf6);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(236,72,153,.4);
    flex-shrink: 0;
}
.brand-title { font-family: 'Playfair Display', Georgia, serif; font-size: 19px; font-weight: 700; }
.brand-sub   { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

/* ============================================================
   Auth (login + not-found)
   ============================================================ */
.auth-body {
    background: radial-gradient(ellipse at top left, #1a0f2e 0%, #0c0d10 55%) fixed;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
.auth-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.auth-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
}
.orb-1 { width: 480px; height: 480px; background: #ec4899; top: -120px; left: -80px; }
.orb-2 { width: 380px; height: 380px; background: #8b5cf6; bottom: -100px; right: -80px; opacity: .5; }
.orb-3 { width: 320px; height: 320px; background: #f59e0b; top: 40%; left: 55%; opacity: .35; }

.auth-shell {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(20, 22, 28, 0.75);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 36px 36px 32px;
    box-shadow: var(--shadow-2);
}
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.auth-card h1 { margin: 0 0 6px; font-size: 28px; }
.auth-lead { color: var(--text-soft); margin: 0 0 24px; font-size: 14.5px; }

/* ============================================================
   Topbar (admin)
   ============================================================ */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(12,13,16,.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1120px; margin: 0 auto;
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Admin shell
   ============================================================ */
.admin-body { background: linear-gradient(180deg, #0c0d10 0%, #0a0b0e 100%) fixed; min-height: 100vh; }
.admin-shell { max-width: 1120px; margin: 0 auto; padding: 36px 24px 80px; }

.hero { margin-bottom: 32px; }
.hero h1 {
    font-size: clamp(32px, 4vw, 44px);
    margin: 0 0 8px;
    background: linear-gradient(120deg, #fff 0%, #fcd34d 60%, #ec4899 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { color: var(--text-soft); font-size: 15px; max-width: 640px; line-height: 1.55; }

.empty-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    color: var(--text-soft);
    max-width: 520px;
    margin: 24px auto;
}
.empty-card h2 { margin: 8px 0 8px; color: var(--text); font-size: 22px; }
.empty-card p  { margin: 0; font-size: 14.5px; }
.empty-icon { font-size: 42px; margin-bottom: 8px; }

/* ============================================================
   Album grid (admin)
   ============================================================ */
.album-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.album-card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
    position: relative;
    overflow: hidden;
    margin-left: calc(var(--depth, 0) * 20px);
}
.album-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    opacity: .65;
}
.album-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-1);
}
.album-card-head { margin-bottom: 14px; }
.album-crumb {
    font-size: 11.5px;
    color: var(--text-mute);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;
    word-break: break-word;
}
.album-title {
    margin: 0 0 6px;
    font-size: 22px;
    color: var(--text);
    word-break: break-word;
}
.album-count { font-size: 12.5px; color: var(--text-mute); display: flex; align-items: center; gap: 8px; }
.pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fde68a;
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.3);
    padding: 2px 8px;
    border-radius: 999px;
}

.album-link input {
    width: 100%;
    background: rgba(0,0,0,.35);
    color: var(--text-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.album-link input:focus {
    outline: none; border-color: var(--accent); color: var(--text);
}
.album-actions { display: flex; gap: 8px; margin-top: 12px; }
.album-actions .btn-primary { padding: 9px 16px; font-size: 13px; }
.album-actions .btn-secondary { padding: 9px 16px; font-size: 13px; }

/* ============================================================
   Settings card (change password)
   ============================================================ */
.settings-card {
    margin-top: 48px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 520px;
}
.settings-card header { margin-bottom: 20px; }
.settings-card h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: var(--text);
}
.settings-card header p { color: var(--text-soft); font-size: 14px; margin: 0; }
.pw-form .btn-primary { margin-top: 6px; }

/* ============================================================
   Public viewer
   ============================================================ */
.view-body {
    background:
        radial-gradient(ellipse at top, rgba(139,92,246,.12) 0%, transparent 50%),
        linear-gradient(180deg, #0c0d10 0%, #0a0b0e 100%) fixed;
    min-height: 100vh;
}

.view-hero {
    padding: 56px 24px 36px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
    position: relative;
    overflow: hidden;
}
.view-hero::after {
    content: '';
    position: absolute; inset: auto 0 -1px 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
    opacity: .35;
}
.view-hero-inner { max-width: 1280px; margin: 0 auto; }
.hero-eyebrow {
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 600;
}
.hero-title {
    margin: 0;
    font-size: clamp(36px, 5vw, 56px);
    background: linear-gradient(120deg, #fff 0%, #fcd34d 50%, #ec4899 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
}
.hero-meta {
    margin-top: 12px;
    display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
    color: var(--text-soft); font-size: 13.5px;
}
.hero-crumb {
    color: var(--text-mute);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}
.hero-count {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.view-main { max-width: 1280px; margin: 0 auto; padding: 28px 16px 80px; }

.section-title {
    display: flex; align-items: baseline; gap: 12px;
    margin: 28px 8px 14px;
    font-size: 20px;
    color: var(--text);
}
.section-title span:first-child {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
}
.section-count {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-mute);
    background: rgba(255,255,255,.05);
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 6px;
}
@media (min-width: 700px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
}
.tile {
    border: 0; padding: 0; background: var(--bg-soft); cursor: pointer;
    aspect-ratio: 1 / 1; overflow: hidden; border-radius: 10px;
    display: block; position: relative;
    transition: transform .25s ease, box-shadow .25s ease;
}
.tile::after {
    content: '';
    position: absolute; inset: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
    border-radius: inherit;
    pointer-events: none;
    transition: box-shadow .2s ease;
}
.tile img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease, opacity .2s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.tile:hover img { transform: scale(1.05); }
.tile:hover::after { box-shadow: inset 0 0 0 2px rgba(245,158,11,.6); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.view-foot {
    text-align: center; color: var(--text-mute); font-size: 12px;
    padding: 16px; border-top: 1px solid var(--line);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(7,8,10,.96);
    display: flex; flex-direction: column;
    user-select: none;
    animation: lb-in .15s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lb-topbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2;
    padding: 16px 18px;
    display: flex; align-items: center; justify-content: space-between;
    color: var(--text); font-size: 14px;
    background: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,0));
}
.lb-counter {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
    font-weight: 600; font-size: 13px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 6px 12px;
}
.lb-actions { display: flex; gap: 6px; }
.lb-btn {
    background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--line);
    padding: 8px 12px; border-radius: 10px; cursor: pointer;
    font-size: 15px; min-width: 40px; line-height: 1;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.lb-btn:hover { background: rgba(255,255,255,.18); border-color: var(--line-strong); }
.lb-btn:active { transform: scale(.96); }
.lb-close { background: rgba(248,113,113,.15); border-color: rgba(248,113,113,.35); }
.lb-close:hover { background: rgba(248,113,113,.3); }

.lb-stage {
    flex: 1;
    display: grid; place-items: center;
    overflow: hidden; position: relative;
    padding: 80px 24px 60px;
}
.lb-stage img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    transition: transform .3s cubic-bezier(.2,.6,.2,1), opacity .2s ease;
    transform-origin: center center;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    border-radius: 6px;
    background: #1a1d24;
}

.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--line);
    width: 52px; height: 64px; border-radius: 14px; cursor: pointer;
    font-size: 32px; line-height: 1; z-index: 2;
    transition: background .15s ease, transform .12s ease;
}
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav:active { transform: translateY(-50%) scale(.95); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
@media (max-width: 560px) {
    .lb-nav { width: 42px; height: 56px; font-size: 26px; border-radius: 10px; }
    .lb-prev { left: 8px; } .lb-next { right: 8px; }
    .lb-stage { padding: 70px 8px 50px; }
}

.lb-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 18px 18px;
    color: var(--text-soft); font-size: 12.5px;
    text-align: center; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
    pointer-events: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
