/* ─────────────────────────────────────────────────────────────
   Love Hub — for Jana
   Soft & cute, rounded, pillowy. Rose palette.
   ───────────────────────────────────────────────────────────── */

:root {
    --rose: #d96b86;
    --rose-deep: #b94b6a;
    --rose-soft: #fbd5de;
    --rose-faint: #fde8ee;
    --rose-pale: #fff5f8;
    --cream: #fff7f9;
    --card: #ffffff;
    --text: #3d2530;
    --muted: #8a6b75;
    --border: #f4dce2;
    --shadow-sm: 0 1px 2px rgba(70, 30, 40, 0.05), 0 4px 12px rgba(217, 107, 134, 0.10);
    --shadow-md: 0 1px 2px rgba(70, 30, 40, 0.06), 0 12px 28px rgba(217, 107, 134, 0.14);
    --shadow-lg: 0 30px 80px rgba(80, 30, 50, 0.22);
    --font: 'Quicksand', system-ui, -apple-system, sans-serif;
    --font-script: 'Caveat', cursive;
    --r-lg: 24px;
    --r-md: 18px;
    --r-sm: 14px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: radial-gradient(1100px 700px at 10% 0%, #ffd9e3 0%, transparent 55%),
    radial-gradient(900px 700px at 100% 100%, #fac6d2 0%, transparent 55%),
    linear-gradient(180deg, #fce0e7 0%, #f5cdd8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    color: inherit;
}

input, textarea {
    font-size: 16px;
}

/* ===================== APP SHELL ===================== */
.app {
    width: 100%;
    max-width: 420px;
    height: min(92vh, 880px);
    background: var(--cream);
    border-radius: 44px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    body {
        padding: 0;
        background: var(--cream);
    }

    .app {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        box-shadow: none;
    }

    .app-body{
        padding-top: env(safe-area-inset-top, 4px) !important;
    }

    .screen--login {
        padding-top: calc(60px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ===================== LOGIN ===================== */
.screen--login {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: linear-gradient(170deg, #ef88a3 0%, #d96b86 100%);
    color: #fff;
    padding: 60px 28px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.screen--login.is-hidden {
    transform: translateY(-30px);
    opacity: 0;
    pointer-events: none;
    transition: transform .5s ease, opacity .4s ease;
}

.login-inner {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-heart {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 30px rgba(140, 30, 60, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
    margin-bottom: 18px;
    animation: float 3.4s ease-in-out infinite;
}

.login-heart img{
    width: 100%;
    padding: 1rem;
}

.login-script {
    font-family: var(--font-script);
    font-size: 28px;
    line-height: 1;
    opacity: .92;
}

.login-title {
    margin: 4px 0 6px;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -.4px;
}

.login-title .wave {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

.login-sub {
    margin: 0 0 28px;
    font-size: 15px;
    opacity: .9;
    font-weight: 500;
}

.pin-dots {
    display: flex;
    gap: 18px;
    margin-bottom: 8px;
    height: 22px;
    align-items: center;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    transition: transform .15s, background .15s;
}

.pin-dot.is-on {
    background: #fff;
    transform: scale(1.1);
}

.pin-dots.shake {
    animation: shake .5s;
}

.pin-error {
    font-size: 13px;
    height: 18px;
    color: #ffe3eb;
    font-weight: 600;
    opacity: 0;
    transition: opacity .2s;
    margin-bottom: 18px;
}

.pin-error.is-on {
    opacity: 1;
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
    margin-top: 8px;
}

.pin-key {
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 26px;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 4px 14px rgba(120, 30, 55, 0.18);
    transition: transform .08s ease, background .15s;
    backdrop-filter: blur(8px);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.pin-key:hover {
    background: rgba(255, 255, 255, 0.28);
}

.pin-key:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.36);
}

.pin-key--ghost {
    background: transparent;
    box-shadow: none;
    font-size: 22px;
}

.pin-key--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===================== APP HEADER ===================== */
.app-header {
    padding: 22px 22px 8px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.app-header__script {
    font-family: var(--font-script);
    font-size: 22px;
    color: var(--rose);
    line-height: 1;
}

.app-header__title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--rose-deep);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform .12s;
}

.icon-btn:hover {
    transform: translateY(-1px);
}

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

/* ===================== APP BODY (scroll) ===================== */
.app-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 22px 110px;
    position: relative;
    z-index: 1;
    scrollbar-width: none;
}

.app-body::-webkit-scrollbar {
    display: none;
}

/* Screens animate in */
.screen {
    animation: fadeUp .35s ease;
}

/* ===================== HERO ===================== */
.hero {
    position: relative;
    border-radius: var(--r-lg);
    padding: 22px 22px 22px 84px;
    margin: 8px 0 22px;
    color: #fff;
    background: linear-gradient(135deg, #ef88a3 0%, #d96b86 100%);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.hero--dates {
    background: linear-gradient(135deg, #d7a3f4 0%, #e58aa5 100%);
}

.hero--ducks {
    background: linear-gradient(135deg, #ffb39a 0%, #e58aa5 100%);
}

.hero__emoji {
    position: absolute;
    left: 18px;
    top: 25%;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    font-size: 28px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
    animation: float 3.4s ease-in-out infinite;
}

.hero__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.15;
}

.hero__sub {
    font-size: 13.5px;
    opacity: .92;
    margin-top: 4px;
    line-height: 1.35;
}

/* ===================== FORMS ===================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form--inline {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
}

.form--inline input {
    flex: 1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--rose-deep);
    letter-spacing: .2px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input[type="text"], input[type="date"], input[type="time"], textarea {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    max-width: 100%;
}

input:focus, textarea:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(217, 107, 134, 0.12);
}

textarea {
    resize: none;
    line-height: 1.5;
}

input::placeholder, textarea::placeholder {
    color: #c9adb5;
}

input[type="date"], input[type="time"] {
    font-family: var(--font);
}

.hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.hint code {
    background: #fde8ee;
    color: var(--rose-deep);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 11px;
}

/* ===================== CHECKBOXES (cute pills) ===================== */
.checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: #fff;
    border: 1.5px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all .15s;
}

.check:hover {
    border-color: #f0b8c6;
}

.check.is-on {
    background: var(--rose-faint);
    border-color: var(--rose);
}

.check__box {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #fff;
    border: 2px solid #e7c4cd;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: all .15s;
}

.check.is-on .check__box {
    background: var(--rose);
    border-color: var(--rose);
}

.check__box svg {
    opacity: 0;
    transition: opacity .12s;
}

.check.is-on .check__box svg {
    opacity: 1;
}

.check__emoji {
    font-size: 16px;
}

.check__label {
    font-weight: 600;
    font-size: 14px;
}

/* ===================== BUTTON ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 54px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15.5px;
    transition: transform .1s ease, box-shadow .15s ease;
    letter-spacing: .1px;
}

.btn--full {
    width: 100%;
}

.btn--icon {
    width: 54px;
    padding: 0;
    flex-shrink: 0;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(180deg, #ef88a3 0%, #d96b86 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 -2px 0 rgba(122, 40, 60, 0.18) inset,
    0 8px 18px rgba(217, 107, 134, 0.35);
}

.btn--primary:hover {
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(1px) scale(0.99);
}

.btn--soft {
    color: var(--rose-deep);
    background: #fff;
    border: 1.5px solid var(--rose-soft);
    box-shadow: var(--shadow-sm);
}

.btn--soft:hover {
    background: var(--rose-faint);
}

.btn--ghost {
    background: transparent;
    color: var(--rose-deep);
}

/* ===================== SUCCESS STATE ===================== */
.success {
    text-align: center;
    padding: 28px 16px;
    background: linear-gradient(180deg, var(--rose-faint) 0%, #fff 100%);
    border-radius: var(--r-lg);
    border: 1.5px dashed var(--rose-soft);
    animation: pop .4s ease;
}

.success__heart {
    font-size: 56px;
    animation: heartbeat 1.4s ease-in-out infinite;
}

.success h2 {
    margin: 8px 0 6px;
    font-size: 22px;
}

.success p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

/* ===================== DATES — TABS + LIST ===================== */
.tabs {
    display: flex;
    gap: 6px;
    background: #fff;
    border-radius: 999px;
    padding: 5px;
    border: 1px solid var(--border);
    margin: 16px 0 14px;
}

.tab {
    flex: 1;
    height: 38px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .18s;
}

.tab.is-active {
    background: linear-gradient(180deg, #ef88a3 0%, #d96b86 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(217, 107, 134, 0.3);
}

.tab .badge {
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.tab:not(.is-active) .badge {
    background: var(--rose-faint);
    color: var(--rose-deep);
}

.date-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: var(--r-md);
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: fadeUp .25s ease;
}

.date-item--done {
    background: var(--rose-pale);
}

.date-item__title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.date-item--done .date-item__title {
    color: var(--muted);
    text-decoration: line-through;
}

.date-item__meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.date-item__done-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e7c4cd;
    display: grid;
    place-items: center;
    transition: all .15s;
}

.date-item__done-btn:hover {
    border-color: var(--rose);
    background: var(--rose-faint);
}

.date-item__done-btn--undo {
    background: var(--rose);
    border-color: var(--rose);
    color: #fff;
}

.date-item__del {
    width: 32px;
    height: 32px;
    margin-left: auto;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #c39ba6;
    opacity: 0;
    transition: opacity .15s, background .15s;
}

.date-item .date-item__del {
    opacity: 1;
}

.date-item__del:hover {
    background: #fff0f3;
    color: var(--rose-deep);
}

.empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--muted);
}

.empty__emoji {
    font-size: 48px;
    margin-bottom: 8px;
}

/* ===================== DUCKS ===================== */
.duck-form {
    gap: 12px;
    align-items: stretch;
}

.duck-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 4px 0 4px;
}

.duck-input {
    width: 76px;
    height: 88px;
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    background: #fff;
    border-radius: 22px;
    border: 2px solid var(--border);
    text-transform: uppercase;
    font-family: var(--font);
    color: var(--rose-deep);
    letter-spacing: 0;
    transition: all .15s;
}

.duck-input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 5px rgba(217, 107, 134, 0.15);
}

.duck-error {
    text-align: center;
    color: var(--rose-deep);
    font-weight: 600;
    font-size: 14px;
    background: var(--rose-faint);
    padding: 10px;
    border-radius: 14px;
    animation: shake .4s;
}

.duck-progress {
    margin: 22px 0 6px;
}

.duck-progress__row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.duck-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--rose-faint);
    overflow: hidden;
    border: 1px solid var(--rose-soft);
}

.duck-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #f7b5c5 0%, #d96b86 100%);
    width: 0%;
    border-radius: 999px;
    transition: width .5s cubic-bezier(.4, 1.6, .5, 1);
}

.list-head {
    margin: 22px 0 12px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.1px;
}

.duck-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.duck-tile {
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 18px;
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    transition: all .18s;
    cursor: default;
    position: relative;
}

.duck-tile__code {
    font-size: 13px;
    letter-spacing: .5px;
}

.duck-tile__emoji {
    font-size: 22px;
    filter: grayscale(1) opacity(0.4);
}

.duck-tile.is-found {
    background: linear-gradient(160deg, #fff 0%, var(--rose-faint) 100%);
    border-color: var(--rose-soft);
    color: var(--rose-deep);
    box-shadow: 0 4px 12px rgba(217, 107, 134, 0.18);
    cursor: pointer;
}

.duck-tile.is-found .duck-tile__emoji {
    filter: none;
    animation: wiggle 2.4s ease-in-out infinite;
}

.duck-tile.is-found:hover {
    transform: translateY(-2px);
}

/* ===================== BOTTOM NAV ===================== */
.bottom-nav {
    position: fixed;
    max-width: 420px;
    margin: 0 auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 28px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    box-shadow: 0 10px 30px rgba(180, 60, 90, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 0 7px;
    border-radius: 20px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    transition: all .2s;
}

.nav-item:hover {
    color: var(--rose-deep);
}

.nav-item.is-active {
    background: linear-gradient(180deg, #ef88a3 0%, #d96b86 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(217, 107, 134, 0.36);
}

.nav-item.is-active svg {
    transform: scale(1.05);
}

.nav-item svg {
    transition: transform .2s;
}

/* ===================== MODAL ===================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    animation: fadeIn .2s ease;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(60, 20, 30, 0.45);
    backdrop-filter: blur(6px);
}

.modal__card {
    position: relative;
    background: #fff;
    border-radius: 32px;
    padding: 32px 28px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: pop .35s ease;
}

.modal__emoji {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 6px;
    animation: wiggle 2.2s ease-in-out infinite;
}

.modal__code {
    display: inline-block;
    font-family: var(--font-script);
    font-size: 26px;
    color: var(--rose);
    background: var(--rose-faint);
    padding: 2px 14px;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal__card h2 {
    margin: 6px 0 8px;
    font-size: 24px;
}

.modal__text {
    color: var(--muted);
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.5;
}

/* ===================== CONFETTI ===================== */
.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 300;
    overflow: hidden;
}

.confetti-heart {
    position: absolute;
    bottom: -30px;
    color: var(--rose);
    font-size: 22px;
    animation: heartUp 2s ease-out forwards;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pop {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    60% {
        opacity: 1;
        transform: scale(1.04);
    }
    100% {
        transform: scale(1);
    }
}

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

.login-heart {
    transform-origin: center;
}

@keyframes wave {
    0%, 60%, 100% {
        transform: rotate(0);
    }
    10% {
        transform: rotate(14deg);
    }
    20% {
        transform: rotate(-8deg);
    }
    30% {
        transform: rotate(14deg);
    }
    40% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-8px);
    }
    40%, 80% {
        transform: translateX(8px);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.15);
    }
    40% {
        transform: scale(0.98);
    }
    60% {
        transform: scale(1.1);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0);
    }
    25% {
        transform: rotate(-6deg);
    }
    75% {
        transform: rotate(6deg);
    }
}

@keyframes heartUp {
    0% {
        transform: translate(0, 0) rotate(var(--r, 0deg)) scale(var(--s, 1));
        opacity: 1;
    }
    100% {
        transform: translate(var(--x, 0), calc(-1 * var(--h, 100vh))) rotate(var(--r2, 40deg)) scale(var(--s, 1));
        opacity: 0;
    }
}
