/* ======================================================
   FamilyPantry — Auth pages (Login / Register)
   Aesthetic: Warm Culinary Editorial
   Palette: Forest Green | Warm Cream | Terracotta | Gold
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;500;700&display=swap');

/* ── Top bar (tema + lingua) ──────────────────────────── */
.auth-topbar {
    position: fixed;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.auth-topbar-btn {
    background: #1b3a2c;
    border: 1.5px solid rgba(27,58,44,.2);
    color: #f5f0e8;
    border-radius: 8px;
    padding: 6px 14px;
    font-family: 'Lato', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    line-height: 1.4;
}

.auth-topbar-btn:hover {
    background: #24503d;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
}

/* ── Shell ────────────────────────────────────────────── */
.auth-shell {
    display: flex;
    min-height: 100vh;
    font-family: 'Lato', sans-serif;
    background: #f7f4ee;
}

/* ── Brand Panel (left) ───────────────────────────────── */
.auth-panel-brand {
    width: 42%;
    background: #1b3a2c;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

/* Jars / spots pattern */
.auth-panel-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 18% 18%, rgba(196,98,58,.18) 52px, transparent 52px),
        radial-gradient(circle at 82% 12%, rgba(232,184,75,.13) 38px, transparent 38px),
        radial-gradient(circle at 55% 48%, rgba(196,98,58,.10) 68px, transparent 68px),
        radial-gradient(circle at 12% 68%, rgba(232,184,75,.15) 44px, transparent 44px),
        radial-gradient(circle at 88% 72%, rgba(196,98,58,.12) 56px, transparent 56px),
        radial-gradient(circle at 38% 88%, rgba(232,184,75,.10) 36px, transparent 36px),
        radial-gradient(circle at 70% 32%, rgba(196,98,58,.08) 30px, transparent 30px),
        radial-gradient(circle at 25% 52%, rgba(232,184,75,.07) 22px, transparent 22px);
}

/* Diagonal warm stripe */
.auth-panel-brand::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 160px;
    height: 130%;
    background: rgba(196,98,58,.12);
    transform: rotate(10deg);
    transform-origin: top right;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 56px 48px;
    color: #f5f0e8;
}

.brand-emblem {
    font-size: 68px;
    margin-bottom: 28px;
    display: block;
    filter: drop-shadow(0 6px 28px rgba(232,184,75,.35));
    animation: floatEmblem 5s ease-in-out infinite;
}

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

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #f5f0e8;
    letter-spacing: -.03em;
    margin: 0 0 4px;
    line-height: 1.1;
}

.brand-name em {
    font-style: italic;
    color: #e8b84b;
}

.brand-divider {
    width: 40px;
    height: 2px;
    background: #c4623a;
    margin: 18px auto 18px;
    border-radius: 2px;
}

.brand-tagline {
    font-size: .95rem;
    color: rgba(245,240,232,.6);
    line-height: 1.65;
    font-weight: 300;
    letter-spacing: .025em;
}

/* ── Form Panel (right) ───────────────────────────────── */
.auth-panel-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    background: #f7f4ee;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
}

/* ── Form heading ──────────────────────────────────────── */
.auth-form-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.95rem;
    font-weight: 600;
    color: #1b3a2c;
    margin: 0 0 6px;
    line-height: 1.2;
}

.auth-form-subtitle {
    font-size: .875rem;
    color: #7c7267;
    margin: 0 0 40px;
    font-weight: 400;
}

/* ── Fields ───────────────────────────────────────────── */
.auth-field {
    margin-bottom: 22px;
}

.auth-field label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    color: #4a4238;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    padding: 13px 16px;
    background: #ffffff;
    border: 1.5px solid #ddd8ce;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: .95rem;
    color: #1f2937;
    transition: border-color .2s ease, box-shadow .2s ease;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

.auth-input:focus {
    border-color: #1b3a2c;
    box-shadow: 0 0 0 3px rgba(27,58,44,.12);
}

.auth-input::placeholder {
    color: #b0a89e;
}

/* ── Error message ────────────────────────────────────── */
.auth-error {
    background: #fff5f5;
    border-left: 3px solid #c4623a;
    color: #7f3520;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: .875rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* ── Success message ──────────────────────────────────── */
.auth-success {
    background: #f0fff4;
    border-left: 3px solid #1b3a2c;
    color: #1b3a2c;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: .875rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* ── Submit button ────────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: 15px 24px;
    background: #1b3a2c;
    color: #f5f0e8;
    border: none;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease, transform .12s ease, box-shadow .2s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(27,58,44,.2);
}

.auth-btn:hover:not(:disabled) {
    background: #24503d;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(27,58,44,.28);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(27,58,44,.2);
}

.auth-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* ── Secondary link ───────────────────────────────────── */
.auth-link-row {
    text-align: center;
    margin-top: 28px;
}

.auth-link-row span {
    font-size: .875rem;
    color: #9d9388;
}

.auth-link {
    color: #c4623a;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease;
    margin-left: 4px;
}

.auth-link:hover {
    color: #1b3a2c;
    text-decoration: underline;
}

/* ── Loading spinner ──────────────────────────────────── */
.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(245,240,232,.3);
    border-top-color: #f5f0e8;
    border-radius: 50%;
    animation: authSpin .75s linear infinite;
    flex-shrink: 0;
}

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

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-shell {
        flex-direction: column;
    }

    .auth-panel-brand {
        width: 100%;
        min-height: 200px;
        flex-shrink: 0;
    }

    .brand-content {
        padding: 36px 32px;
    }

    .brand-emblem {
        font-size: 48px;
        margin-bottom: 16px;
    }

    .brand-name {
        font-size: 2rem;
    }

    .auth-panel-form {
        padding: 40px 24px;
    }
}

/* Bottone occhio mostra/nascondi password */
.auth-eye-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.6;
    margin-top: 0.7rem;
}
.auth-eye-btn:hover { opacity: 1; }
