/* ---------- Reset & base ---------- */

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

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    color: #1f2937;
    background: linear-gradient(160deg, #e4e5e7 0%, #f9efbe 100%);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: #111827; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: #111827; margin-top: 0; }

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------- Header / footer ---------- */

.site-header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    gap: 1rem;
}

.site-logo { display: flex; align-items: center; gap: 0.6rem; }
.site-logo img { height: 40px; width: auto; max-width: 200px; }
.site-logo__text { font-weight: 700; font-size: 1.05rem; color: #111827; }

.site-nav a {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
}
.site-nav a:hover { background: rgba(0,0,0,0.05); text-decoration: none; }

.site-main { padding: 3rem 0 4rem; }

.site-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ---------- Hero / card form ---------- */

.card-hero { text-align: center; margin-bottom: 2.5rem; }
.card-hero h1 {
    font-size: clamp(1.6rem, 2.8vw, 2.5rem);
    margin-bottom: 0.5rem;
}
.card-hero__lede { color: #4b5563; font-size: 1.1rem; margin: 0; }

.card-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 820px) {
    .card-layout { grid-template-columns: 1fr; }
}

.card-layout__preview {
    margin: 0;
    padding: 1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    text-align: center;
}
.card-layout__preview img { border-radius: 10px; margin: 0 auto; }
.card-layout__preview figcaption {
    margin-top: 0.75rem;
    font-weight: 600;
    color: #374151;
}

.card-form {
    padding: 2rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.card-form__label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.card-form__input {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.card-form__input:focus {
    outline: none;
    border-color: #fed120;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(254, 209, 32, 0.25);
}
.card-form__input.is-invalid { border-color: #ef4444; }

.card-form__error { color: #b91c1c; margin: 0.5rem 0 0; font-size: 0.9rem; }
.card-form__help  { color: #6b7280; margin-top: 0.75rem; font-size: 0.85rem; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 150ms, color 150ms, transform 75ms, border-color 150ms;
    text-decoration: none;
    font-family: inherit;
}
.btn--sm    { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.btn--full  { width: 100%; margin-top: 1.25rem; }
.btn--primary {
    background: #111827;
    color: #fff;
}
.btn--primary:hover { background: #374151; color: #fed120; text-decoration: none; }
.btn--primary:active { transform: translateY(1px); }

.btn--ghost {
    background: #111827;
    color: #fff;
    border-color: #111827;
}
.btn--ghost:hover { background: #374151; color: #fed120; text-decoration: none; }

.btn--danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.btn--danger:hover { background: #fee2e2; text-decoration: none; }

/* ---------- Auth (login) ---------- */

.auth-shell {
    min-height: 60vh;
    display: grid;
    place-items: center;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.25rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}
.auth-card__title { margin-bottom: 0.25rem; }
.auth-card__lede  { color: #6b7280; margin-top: 0; margin-bottom: 1.5rem; }

/* Generic form styling (shared with auth) */
.form__group { margin-bottom: 1.1rem; }
.form__group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #374151;
}
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="file"],
.form select,
.form textarea {
    width: 100%;
    font-size: 1rem;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-family: inherit;
    transition: border-color 150ms, background 150ms, box-shadow 150ms;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none;
    border-color: #fed120;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(254, 209, 32, 0.25);
}
.form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem;
    cursor: pointer;
}
.form__actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; }

/* ---------- Alerts ---------- */

.alert {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.alert--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert--info    { background: #fff8cc; color: #111827; border: 1px solid #fed120; text-align: center; }
.alert ul { margin: 0.25rem 0 0 1rem; padding: 0; }

/* ---------- Maintenance page ---------- */

body.maintenance {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem;
}
.maintenance__panel {
    max-width: 480px;
    text-align: center;
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}
.maintenance__logo {
    max-height: 80px;
    margin: 0 auto 1.5rem;
}
.maintenance__panel h1 { margin-bottom: 0.5rem; }
.maintenance__panel p  { color: #4b5563; margin: 0; }

/* ── Entrance animations — pure CSS ── */
@keyframes aFadeUp   { from{ opacity:0; transform:translateY(22px) } to{ opacity:1; transform:translateY(0) } }
@keyframes aFadeDown { from{ opacity:0; transform:translateY(-16px) } to{ opacity:1; transform:translateY(0) } }
@keyframes aFadeLeft { from{ opacity:0; transform:translateX(-36px) } to{ opacity:1; transform:translateX(0) } }
@keyframes aFadeRight{ from{ opacity:0; transform:translateX(36px) } to{ opacity:1; transform:translateX(0) } }

.site-logo            { animation:aFadeDown  .70s cubic-bezier(.16,1,.3,1) both }
.card-hero h1         { animation:aFadeUp    .75s cubic-bezier(.16,1,.3,1) both .08s }
.card-hero__lede      { animation:aFadeUp    .65s cubic-bezier(.16,1,.3,1) both .18s }
.card-layout__preview { animation:aFadeLeft  .80s cubic-bezier(.16,1,.3,1) both .26s }
.card-form            { animation:aFadeRight .80s cubic-bezier(.16,1,.3,1) both .26s }

/* Button press feedback — CSS-only, no JS needed */
.btn--primary { transition:transform .30s cubic-bezier(.34,1.56,.64,1), background-color 150ms, color 150ms, border-color 150ms }
.btn--primary:active { transform:scale(.96); transition-duration:.10s, 150ms, 150ms, 150ms }

/* Live preview crossfade */
#card-preview { transition:opacity .30s ease }

/* ---------- Password field with show/hide toggle ---------- */
.password-field { position: relative; }
.password-field input[type="password"],
.password-field input[type="text"] { padding-right: 2.75rem; }
.password-field__toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0;
    transition: color 150ms, background 150ms;
}
.password-field__toggle:hover { color: #111827; background: rgba(0,0,0,0.04); }
.password-field__toggle .eye-off { display: none; }
.password-field__toggle.is-shown .eye { display: none; }
.password-field__toggle.is-shown .eye-off { display: block; }

/* ---------- Video greeting card preview ---------- */
.card-media {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
}
.card-media img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}
.card-name-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    line-height: 1.25;
    white-space: pre;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Two-line name field on the public card form */
textarea.card-form__input {
    font-family: inherit;
    resize: none;
    line-height: 1.4;
}
.card-form__input--name { height: 5.2rem; }
.card-form__hint {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.9rem;
}
.card-media__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}
.card-media__badge svg { width: 13px; height: 13px; }

/* ---------- Card gallery (landing page) ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.gallery__item {
    display: block;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    text-decoration: none;
    transition: transform 150ms, box-shadow 150ms;
}
.gallery__item:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.14);
    text-decoration: none;
}
.gallery__thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    overflow: hidden;
}
.gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery__thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 0.9rem;
}
.gallery__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.8);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}
.gallery__badge svg { width: 12px; height: 12px; }
.gallery__title {
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: #1f2937;
}
.card-hero__back {
    display: inline-block;
    margin-bottom: 0.6rem;
    color: #6b7280;
    font-size: 0.9rem;
    text-decoration: none;
}
.card-hero__back:hover { color: #111827; }
