/* ==========================================================================
   Universul Nostru — stiluri
   Mobile-first. Fără dependențe externe în afară de Google Fonts.
   ========================================================================== */

:root {
    --rose-50: #fff1f4;
    --rose-100: #ffe3ea;
    --rose-200: #ffc9d6;
    --rose-300: #ff9fb5;
    --rose-400: #f9738f;
    --rose-500: #f35777;
    --rose-600: #e11d48;
    --rose-700: #be123c;
    --rose-800: #9f1239;
    --ink: #3d0314;
    --ink-soft: #7a3346;
    --cream: #fff8f1;
    --paper: #fffdfa;
    --note-top: #fff9c9;
    --note-bottom: #fff1a1;
    --night: rgba(24, 4, 12, 0.97);

    --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 26px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(61, 3, 20, 0.06), 0 2px 8px rgba(61, 3, 20, 0.06);
    --shadow-md: 0 12px 24px -10px rgba(61, 3, 20, 0.22), 0 3px 8px rgba(61, 3, 20, 0.07);
    --shadow-lg: 0 28px 50px -16px rgba(61, 3, 20, 0.38), 0 10px 18px -6px rgba(61, 3, 20, 0.12);
    --shadow-rose: 0 12px 28px -8px rgba(225, 29, 72, 0.55);

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);

    --content-max: 1100px;
}

/* ---------- Bază ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--cream);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fundal stratificat roz -> crem (pe pseudo-element fix: background-attachment:fixed nu merge pe iOS) */
body::before {
    content: '';
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 15% -5%, rgba(243, 87, 119, 0.38), transparent 60%),
        radial-gradient(ellipse 60% 45% at 100% 20%, rgba(255, 159, 181, 0.35), transparent 60%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(255, 201, 214, 0.45), transparent 60%),
        linear-gradient(180deg, #ffd3dd 0%, #ffe9ee 32%, #fff4f1 65%, var(--cream) 100%);
}

body.locked { overflow: hidden; }

body.scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

img { max-width: 100%; }

::selection { background: rgba(243, 87, 119, 0.32); }

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

a { -webkit-tap-highlight-color: transparent; }

/* Selecția e dezactivată DOAR pe elementele decorative / galerie — niciodată pe input-uri */
.heart-bg,
.stars,
.lock-heart,
.lock-loader,
.site-title,
.polaroid,
.date-pill,
.fab,
.lightbox-nav,
.confetti-heart {
    -webkit-user-select: none;
    user-select: none;
}

.polaroid img {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Focus vizibil (regulile cu :focus-visible sunt separate ca să nu invalideze selectori în Safari 14) */
:focus-visible {
    outline: 3px solid var(--rose-600);
    outline-offset: 3px;
}

:focus:not(:focus-visible) { outline: none; }

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.noscript {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 2000;
    margin: 0;
    padding: 14px;
    text-align: center;
    background: var(--rose-700);
    color: #fff;
    font-weight: 600;
}

/* ---------- Butoane ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 46px;
    padding: 0.7em 1.5em;
    border: 0;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn[disabled] { opacity: 0.65; cursor: progress; }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--rose-600) 0%, var(--rose-700) 100%);
    box-shadow: var(--shadow-rose), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-ghost {
    color: var(--ink);
    background: #fff;
    box-shadow: inset 0 0 0 1.5px var(--rose-200);
}

.btn-danger {
    color: #fff;
    background: var(--rose-600);
    box-shadow: 0 8px 18px -8px rgba(225, 29, 72, 0.7);
}

.btn-block { width: 100%; }

@media (hover: hover) {
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -8px rgba(225, 29, 72, 0.6); }
    .btn-ghost:hover { background: var(--rose-50); }
    .btn-danger:hover { background: var(--rose-700); }
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(225, 29, 72, 0.1);
    transition: transform 0.2s var(--ease-out), opacity 0.2s ease, background-color 0.2s ease;
}

.icon-btn:active { transform: scale(0.92); }

@media (hover: hover) {
    .icon-btn:hover { background: #fff; transform: translateY(-1px); }
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    min-height: 42px;
    padding: 0.5em 1.15em;
    border: 1.5px solid var(--rose-300);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--rose-700);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s var(--ease-out);
}

.pill-btn:active { transform: scale(0.97); }

@media (hover: hover) {
    .pill-btn:hover { background: var(--rose-600); border-color: var(--rose-600); color: #fff; }
}

/* Intrarea in muzeul 3D: umplere roz + sclipire discreta */
.museum-btn {
    position: relative;
    overflow: hidden;
    border-color: transparent;
    background: linear-gradient(135deg, var(--rose-500) 0%, var(--rose-600) 55%, var(--rose-700) 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-rose), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.museum-btn::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
    transform: translateX(-120%) skewX(-18deg);
    animation: museumShimmer 4.5s ease-in-out 1.2s infinite;
    pointer-events: none;
}

@keyframes museumShimmer {
    0%, 62% { transform: translateX(-120%) skewX(-18deg); }
    100% { transform: translateX(330%) skewX(-18deg); }
}

.museum-btn:focus-visible { outline-color: var(--rose-800); }

@media (hover: hover) {
    .museum-btn:hover {
        background: linear-gradient(135deg, var(--rose-600) 0%, var(--rose-700) 100%);
        border-color: transparent;
        transform: translateY(-1px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .museum-btn::after { display: none; }
}

.link-btn {
    min-height: 36px;
    padding: 0.35em 0.9em;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--rose-700);
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.link-btn.is-active {
    opacity: 1;
    color: #fff;
    background: var(--rose-600);
}

/* ---------- Decor fundal ---------- */
.heart-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 70vw;
    max-width: 520px;
    height: auto;
    pointer-events: none;
    opacity: 0.26;
    filter: blur(10px);
    transform: translate(-50%, -50%);
    animation: heartPulse 6s ease-in-out infinite;
    will-change: transform;
}

@keyframes heartPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.stars {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #ffd23f;
    box-shadow: 0 0 6px 1px rgba(255, 210, 63, 0.75);
    opacity: 0;
    animation: twinkle var(--d, 4s) ease-in-out var(--delay, 0s) infinite;
    will-change: transform, opacity;
}

@keyframes twinkle {
    0%, 100% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1); opacity: 0.7; }
}

.confetti-heart {
    position: fixed;
    z-index: 1350;
    pointer-events: none;
    font-size: 18px;
    line-height: 1;
    will-change: transform, opacity;
}

/* ---------- Ecran de blocare ---------- */
.lock-screen {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--safe-top)) calc(20px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(20px + var(--safe-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.35), transparent 42%),
        radial-gradient(circle at 85% 85%, rgba(190, 18, 60, 0.35), transparent 50%),
        linear-gradient(160deg, #f35777 0%, #fb7a93 48%, #ffc2cf 100%);
    visibility: visible;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

body.unlocked .lock-screen {
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.8s;
}

.lock-screen.no-transition { transition: none !important; }

.lock-card {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: auto;
    padding: 30px 24px 26px;
    text-align: center;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 30px 60px -22px rgba(120, 10, 40, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: opacity 0.45s ease, transform 0.45s var(--ease-out);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .lock-card { background: rgba(255, 255, 255, 0.94); }
}

.lock-screen.is-checking .lock-card {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    pointer-events: none;
}

.lock-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lock-loader img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: heartbeat 1.2s ease-in-out infinite;
}

.lock-screen.is-checking .lock-loader { opacity: 1; }

.lock-heart {
    display: block;
    width: 92px;
    height: 92px;
    margin: -6px auto 8px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(225, 29, 72, 0.35));
    animation: heartbeat 2.4s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.08); }
    30% { transform: scale(0.98); }
    45% { transform: scale(1.05); }
    60% { transform: scale(1); }
}

.lock-title {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.05;
    color: var(--rose-700);
}

.lock-sub {
    margin: 4px 0 20px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.input-wrap { position: relative; }

.lock-input {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 52px;
    border: 1.5px solid rgba(225, 29, 72, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font: inherit;
    font-size: 16px; /* evită zoom-ul automat pe iOS */
    letter-spacing: 0.12em;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lock-input::placeholder { color: rgba(122, 51, 70, 0.45); }

/* Edge/IE: ascundem butonul nativ de „arată parola” (avem propriul buton 👁️) */
.lock-input::-ms-reveal { display: none; }

.lock-input:focus {
    outline: none;
    border-color: var(--rose-500);
    box-shadow: 0 0 0 4px rgba(243, 87, 119, 0.22);
}

.lock-input[aria-invalid="true"] { border-color: var(--rose-600); }

.toggle-pass {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    font-size: 1.05rem;
    transform: translateY(-50%);
    opacity: 0.7;
}

.toggle-pass[aria-pressed="true"] { opacity: 1; }

.lock-error {
    min-height: 1.5em;
    margin: 10px 0 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--rose-800);
}

.shake { animation: shake 0.45s ease both; }

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}

/* ---------- Conținut pagină ---------- */
.page-content {
    position: relative;
    z-index: 2;
    padding-bottom: calc(120px + var(--safe-bottom));
    opacity: 1;
    transition: opacity 0.8s ease;
}

body:not(.unlocked) .page-content {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---------- Antet ---------- */
.site-header {
    position: relative;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: calc(34px + var(--safe-top)) calc(20px + var(--safe-right)) 6px calc(20px + var(--safe-left));
    text-align: center;
}

.lock-btn {
    position: absolute;
    top: calc(12px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
    opacity: 0.55;
}

.lock-btn:hover { opacity: 1; }
.lock-btn:focus-visible { opacity: 1; }

.site-title {
    display: inline-block;
    margin: 0;
    padding: 0 0.12em;
    font-family: var(--font-hand);
    font-size: clamp(2.9rem, 11vw, 4.6rem);
    font-weight: 700;
    line-height: 1;
    color: var(--rose-600);
    background: linear-gradient(135deg, var(--rose-500) 0%, var(--rose-600) 45%, var(--rose-800) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.85)) drop-shadow(0 8px 18px rgba(225, 29, 72, 0.18));
}

.site-subtitle {
    margin: 6px 0 0;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
}

.site-subtitle .dot { margin: 0 0.3em; opacity: 0.6; }

.together-text {
    font-weight: 600;
    color: var(--rose-700);
    white-space: nowrap;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.date-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 42px;
    padding: 3px 4px 3px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--rose-200);
    transition: box-shadow 0.2s ease;
}

.date-filter.is-active { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--rose-500); }

.date-filter-icon { font-size: 0.9rem; }

.date-input {
    min-width: 138px;
    min-height: 36px;
    padding: 0 6px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.date-input::-webkit-date-and-time-value { text-align: left; }

.date-input:focus { outline: none; }

.date-filter:focus-within { box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--rose-600); }

.album-stats {
    min-height: 1.4em;
    margin: 12px 0 0;
    font-size: 0.78rem;
    color: var(--ink-soft);
    opacity: 0.85;
}

/* ---------- Mesajul zilei (sticky note) ---------- */
.note-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 20px 6px;
}

.sticky-note {
    position: relative;
    width: 100%;
    max-width: 330px;
    padding: 28px 24px 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--note-top) 0%, var(--note-bottom) 100%);
    border-bottom-right-radius: 60px 6px;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.04),
        0 16px 26px -14px rgba(110, 80, 0, 0.4),
        10px 12px 20px -12px rgba(0, 0, 0, 0.14);
    transform: rotate(-1.5deg);
}

/* bandă adezivă */
.sticky-note::before {
    content: '';
    position: absolute;
    top: -13px;
    left: 50%;
    width: 112px;
    height: 28px;
    margin-left: -56px;
    background: linear-gradient(180deg, rgba(255, 201, 214, 0.78), rgba(255, 170, 192, 0.7));
    box-shadow: 0 2px 5px rgba(61, 3, 20, 0.1);
    transform: rotate(-3deg);
    border-left: 2px dotted rgba(255, 255, 255, 0.6);
    border-right: 2px dotted rgba(255, 255, 255, 0.6);
}

.note-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(110, 80, 0, 0.6);
}

.note-text {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.2;
    color: #4a2a05;
}

/* ---------- Album ---------- */
.album {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 6px calc(14px + var(--safe-right)) 0 calc(14px + var(--safe-left));
}

.date-section { margin: 28px 0 44px; }

.date-header {
    position: -webkit-sticky;
    position: sticky;
    top: calc(10px + var(--safe-top));
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 4px 20px;
    pointer-events: none;
}

.date-header > * { pointer-events: auto; }

.date-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 8px 6px 18px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(225, 29, 72, 0.12);
}

.date-title {
    margin: 0;
    overflow: hidden;
    font-family: var(--font-hand);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--rose-700);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.date-count {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--rose-600);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.section-dl { flex-shrink: 0; }

/* locurile zilei, sub pastila cu data (nu e sticky) */
.date-places {
    max-width: calc(100% - 28px);
    margin: -12px 14px 18px 20px;
    overflow: hidden;
    color: var(--rose-700);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
    padding: 0 6px;
}

@media (min-width: 480px) {
    .gallery-grid {
        /* auto-fit + centrare: zilele cu puține poze nu rămân lipite în stânga */
        grid-template-columns: repeat(auto-fit, minmax(170px, 220px));
        justify-content: center;
        gap: 32px 26px;
        padding: 0 10px;
    }
}

/* ---------- Polaroid ---------- */
.polaroid {
    --r: 0deg;
    position: relative;
    padding: 8px 8px 30px;
    border-radius: 3px;
    background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
    box-shadow: var(--shadow-md);
    transform: rotate(var(--r));
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, opacity 0.35s ease;
    animation: cardIn 0.5s var(--ease-out) backwards;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) rotate(var(--r)) scale(0.96); }
    to { opacity: 1; transform: rotate(var(--r)); }
}

/* bandă adezivă pe unele poze (efect scrapbook) */
.polaroid:nth-child(5n + 2)::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    z-index: 2;
    width: 64px;
    height: 20px;
    margin-left: -32px;
    background: rgba(255, 201, 214, 0.75);
    box-shadow: 0 1px 3px rgba(61, 3, 20, 0.12);
    transform: rotate(-4deg);
    pointer-events: none;
}

/* inimioară discretă pe banda de jos */
.polaroid::after {
    content: '♥';
    position: absolute;
    right: 10px;
    bottom: 6px;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--rose-200);
    pointer-events: none;
}

@media (hover: hover) {
    .polaroid:hover {
        z-index: 3;
        transform: rotate(0deg) translateY(-6px) scale(1.04);
        box-shadow: var(--shadow-lg);
    }
}

.polaroid:focus-within {
    z-index: 3;
    transform: rotate(0deg) scale(1.03);
    box-shadow: var(--shadow-lg);
}

/* poza are locație (titlul = locul) */
.polaroid-pin {
    position: absolute;
    bottom: 6px;
    left: 9px;
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.85;
    cursor: default;
}

.polaroid-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: none;
    cursor: zoom-in;
}

.polaroid-open:focus-visible { outline-offset: 4px; }

.polaroid-photo {
    position: relative;
    display: block;
    padding-top: 100%; /* pătrat; compatibil Safari 14 (fără aspect-ratio) */
    overflow: hidden;
    border-radius: 2px;
    background: #f6e6ea;
    box-shadow: inset 0 0 0 1px rgba(61, 3, 20, 0.05);
}

/* skeleton shimmer */
.polaroid-photo::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    to { transform: translateX(100%); }
}

.polaroid-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.5s ease, transform 0.6s var(--ease-out);
}

.polaroid-photo.is-loaded { background: #f3f0f0; }
.polaroid-photo.is-loaded::before { display: none; }
.polaroid-photo.is-loaded img { opacity: 1; transform: none; }

.polaroid-photo.is-error::before { display: none; }

.polaroid-photo.is-error::after {
    content: '💔';
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.8rem;
    transform: translate(-50%, -50%);
    opacity: 0.6;
}

.polaroid-delete {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.25s var(--ease-spring);
}

.polaroid-delete-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--rose-600);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.45);
}

.polaroid:hover .polaroid-delete,
.polaroid:focus-within .polaroid-delete {
    opacity: 1;
    transform: scale(1);
}

.polaroid-delete:focus-visible { opacity: 1; transform: scale(1); }

@media (hover: none) {
    .polaroid-delete { opacity: 1; transform: scale(1); }
}

.polaroid.is-removing {
    opacity: 0;
    transform: rotate(var(--r)) translateY(12px) scale(0.8);
    pointer-events: none;
}

/* skeleton (încărcare inițială) */
.polaroid.is-skeleton { animation: none; }
.polaroid.is-skeleton::after { display: none; }

.date-pill.is-skeleton {
    width: 190px;
    height: 44px;
    background: rgba(255, 255, 255, 0.6);
}

/* ---------- Stări goale / eroare ---------- */
.empty-state {
    max-width: 420px;
    margin: 24px auto;
    padding: 40px 24px;
    text-align: center;
}

.empty-emoji {
    display: inline-block;
    font-size: 3rem;
    line-height: 1;
    animation: floaty 3.2s ease-in-out infinite;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-title {
    margin: 12px 0 4px;
    font-family: var(--font-hand);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--rose-700);
}

.empty-title + .btn { margin-top: 16px; }

.empty-text {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* ---------- Buton flotant (+) ---------- */
.fab {
    position: fixed;
    right: calc(20px + var(--safe-right));
    bottom: calc(22px + var(--safe-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 2.3rem;
    font-weight: 300;
    line-height: 1;
    background: linear-gradient(135deg, var(--rose-500) 0%, var(--rose-600) 50%, var(--rose-700) 100%);
    box-shadow: var(--shadow-rose), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}

.fab span {
    display: block;
    margin-top: -3px;
    transition: transform 0.35s var(--ease-spring);
}

.fab::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border: 2px solid var(--rose-500);
    border-radius: 50%;
    pointer-events: none;
    animation: ring 2.6s ease-out infinite;
}

@keyframes ring {
    0% { transform: scale(1); opacity: 0.7; }
    80%, 100% { transform: scale(1.65); opacity: 0; }
}

.fab:active { transform: scale(0.93); }

@media (hover: hover) {
    .fab:hover { transform: scale(1.06); box-shadow: 0 18px 36px -8px rgba(225, 29, 72, 0.65); }
    .fab:hover span { transform: rotate(90deg); }
}

.fab:focus-visible { outline-offset: 5px; }

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    clip: rect(0 0 0 0);
}

/* ---------- Modale (comun) ---------- */
.modal {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.is-open { opacity: 1; }

/* ---------- Confirmare ștergere ---------- */
.confirm-modal {
    z-index: 1100;
    padding: 20px;
    background: rgba(40, 6, 18, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.confirm-box {
    width: 100%;
    max-width: 320px;
    padding: 26px 22px 22px;
    border-radius: var(--radius-lg);
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(10px);
    transition: transform 0.35s var(--ease-spring);
}

.confirm-modal.is-open .confirm-box { transform: none; }

.confirm-thumb {
    display: block;
    width: 88px;
    height: 88px;
    margin: -60px auto 14px;
    border: 5px solid #fff;
    border-bottom-width: 14px;
    border-radius: 3px;
    object-fit: cover;
    background: #f6e6ea;
    box-shadow: var(--shadow-md);
    transform: rotate(-4deg);
}

.confirm-title {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--rose-700);
}

.confirm-desc {
    margin: 6px 0 20px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

.confirm-actions .btn { flex: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    background: var(--night);
    color: #fff;
}

.lightbox-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + var(--safe-top)) calc(12px + var(--safe-right)) 6px calc(18px + var(--safe-left));
}

.lightbox-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-width: 0;
}

.lightbox-date {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.lightbox-counter {
    font-size: 0.78rem;
    opacity: 0.7;
}

.lightbox-place,
.lightbox-note {
    flex-basis: 100%;
    min-width: 0;
    margin: 0;
    line-height: 1.35;
}

.lightbox-place { font-size: 0.88rem; }

.lightbox-place-link {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.lightbox-place-link:hover { text-decoration-color: #fff; }
.lightbox-place-link:focus-visible { outline-color: #fff; }

.lightbox-note {
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.65;
}

.lightbox-close {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-close:focus-visible { outline-color: #fff; }

.lightbox-stage {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px calc(12px + var(--safe-right)) 8px calc(12px + var(--safe-left));
    touch-action: pan-y pinch-zoom;
}

@media (min-width: 720px) {
    .lightbox-stage { padding: 8px 76px; }
}

.lightbox-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.55));
}

.lightbox-img.is-entering { animation: lbIn 0.35s var(--ease-out); }

@keyframes lbIn {
    from { opacity: 0.3; transform: scale(0.96); }
    to { opacity: 1; transform: none; }
}

/* indicator de încărcare pentru imaginea mare */
.lightbox-stage::after {
    content: '';
    position: absolute;
    bottom: 18px;
    left: 50%;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    animation: spin 0.9s linear infinite;
}

.lightbox-stage.is-loading::after {
    opacity: 1;
    transition-delay: 0.2s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    padding: 0 0 4px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.26); }
.lightbox-nav:active { transform: scale(0.92); }
.lightbox-nav:focus-visible { outline-color: #fff; }

.lightbox-prev { left: calc(10px + var(--safe-left)); }
.lightbox-next { right: calc(10px + var(--safe-right)); }

@media (min-width: 720px) {
    .lightbox-prev { left: 16px; }
    .lightbox-next { right: 16px; }
}

.lightbox-bottom {
    display: flex;
    justify-content: center;
    padding: 10px 20px calc(18px + var(--safe-bottom));
}

.lightbox-bottom .btn:focus-visible { outline-color: #fff; }

/* ---------- Upload overlay ---------- */
.upload-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #fff;
    text-align: center;
    background: linear-gradient(160deg, rgba(243, 87, 119, 0.95) 0%, rgba(190, 18, 60, 0.96) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.upload-overlay.is-open { opacity: 1; }
.upload-overlay:focus { outline: none; }

.upload-card {
    width: 100%;
    max-width: 360px;
}

.upload-heart {
    font-size: 3.2rem;
    line-height: 1;
    animation: heartbeat 1.2s ease-in-out infinite;
}

.upload-title {
    margin: 14px 0 6px;
    font-family: var(--font-hand);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
}

.upload-count {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
}

.progress {
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.28);
}

.progress-bar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.2s linear;
}

.upload-file {
    min-height: 1.4em;
    margin: 10px 0 0;
    overflow: hidden;
    font-size: 0.78rem;
    opacity: 0.85;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.upload-hint {
    margin: 18px 0 0;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ---------- Toast-uri ---------- */
.toast-region {
    position: fixed;
    left: 50%;
    bottom: calc(100px + var(--safe-bottom));
    z-index: 1400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 92vw;
    max-width: 420px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 8px 12px 16px;
    border-radius: 18px;
    background: rgba(61, 3, 20, 0.93);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastIn 0.4s var(--ease-spring) backwards;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-success { background: linear-gradient(135deg, rgba(190, 18, 60, 0.96), rgba(225, 29, 72, 0.96)); }
.toast-error { box-shadow: var(--shadow-lg), inset 3px 0 0 #ffb4c4; }

.toast.is-leaving { opacity: 0; transform: translateY(8px) scale(0.98); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.toast-icon {
    flex-shrink: 0;
    padding-top: 1px;
    font-size: 1rem;
    line-height: 1.4;
}

.toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.toast-title {
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}

.toast-lines {
    margin: 6px 0 0;
    padding-left: 1.1em;
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.9;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin: -4px 0 -4px auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.7;
}

.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.toast-close:focus-visible { outline-color: #fff; outline-offset: 0; }

/* ---------- Mișcare redusă ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    .heart-bg { animation: none; will-change: auto; }
    .star { animation: none; opacity: 0.45; will-change: auto; }
    .fab::before { display: none; }
    .polaroid-photo::before { animation: none; display: none; }
    .lightbox-stage::after { animation: none; }
}
