/* =====================================================================
   Nursery360 — Auth screens (login / forgot / reset)
   "Bizobook" terracotta theme, light background — matches d.nurserylive.
   Self-contained (the auth pages render standalone, no admin chrome).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
    --t-brand:       #D96B3F;   /* terracotta primary */
    --t-brand-dark:  #B85530;   /* hover / pressed */
    --t-brand-deep:  #7a3a20;
    --t-tint:        #F7D9C6;   /* peachy background tint */
    --t-ink:         #14181F;
    --t-muted:       #6B6760;
    --t-line:        #e6ecf3;
    --t-danger:      #c0392b;
    --t-danger-bg:   #fdecea;
    --t-success:     #1b7a43;
    --t-success-bg:  #e7f6ed;
    --t-radius:      16px;
    --t-shadow:      0 12px 40px rgba(13, 38, 76, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
    font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--t-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- Full-bleed light background (d.nurserylive recipe) ---------- */
.auth-bg {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(217, 107, 63, .12), transparent 60%),
        linear-gradient(180deg, var(--t-tint) 0%, #f4f7fb 100%);
}

/* Decorative leaves — subtle terracotta tint on the light bg */
.auth-leaf { position: absolute; color: rgba(217, 107, 63, .10); pointer-events: none; z-index: 0; }
.auth-leaf--1 { top: -40px; left: -30px; width: 220px; transform: rotate(-18deg); }
.auth-leaf--2 { bottom: -60px; right: -40px; width: 300px; transform: rotate(160deg); color: rgba(184, 85, 48, .08); }
.auth-leaf--3 { top: 18%; right: 8%; width: 90px; transform: rotate(28deg); color: rgba(217, 107, 63, .08); }

/* ---------- Card ---------- */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--t-line);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
    padding: 2rem;
    animation: auth-rise .5s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Brand ---------- */
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand__mark {
    width: 56px; height: 56px; border-radius: 16px;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(140deg, #E07A4A, var(--t-brand-dark));
    box-shadow: 0 10px 20px -8px rgba(217, 107, 63, .7);
}
.auth-brand__mark svg { width: 30px; height: 30px; }
.auth-brand__name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--t-ink); }
.auth-brand__name span { color: var(--t-brand); }
.auth-sub { margin: 0 0 20px; text-align: center; color: var(--t-muted); font-size: 14px; }

/* ---------- Segmented tabs ---------- */
.auth-seg { display: flex; gap: 4px; background: #f1f4f8; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-seg__btn {
    flex: 1; border: 0; background: transparent; color: var(--t-muted);
    font-size: 14px; font-weight: 600; padding: 10px 8px; border-radius: 9px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    transition: background .18s, color .18s, box-shadow .18s; min-height: 42px;
}
.auth-seg__btn svg { width: 15px; height: 15px; }
.auth-seg__btn.is-active { background: #fff; color: var(--t-brand); box-shadow: 0 2px 6px -2px rgba(13, 38, 76, .25); }

/* ---------- Panels ---------- */
.auth-panel { display: none; }
.auth-panel.is-active { display: block; animation: auth-fade .25s ease both; }
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Fields ---------- */
.auth-field { margin-bottom: 16px; }
.auth-field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--t-ink); margin-bottom: 6px; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input__icon { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--t-muted); pointer-events: none; }
.auth-input input {
    width: 100%; height: 48px; padding: 0 14px 0 42px;
    font-size: 16px; /* 16px avoids iOS zoom-on-focus */ color: var(--t-ink);
    background: #f8fafc; border: 1.5px solid var(--t-line); border-radius: 11px; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input input::placeholder { color: #aab2bd; }
.auth-input input:focus { background: #fff; border-color: #e3a98f; box-shadow: 0 0 0 3.5px rgba(217, 107, 63, .20); }
.auth-input__toggle {
    position: absolute; right: 8px; width: 34px; height: 34px; border: 0; background: transparent;
    color: var(--t-muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center;
}
.auth-input__toggle:hover { color: var(--t-brand); background: #f1f4f8; }
.auth-input__toggle svg { width: 18px; height: 18px; }
.auth-input--has-toggle input { padding-right: 46px; }

/* ---------- Row: remember + forgot ---------- */
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 13.5px; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; color: var(--t-muted); cursor: pointer; user-select: none; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--t-brand); cursor: pointer; }

/* ---------- Buttons & links ---------- */
.auth-btn {
    width: 100%; min-height: 50px; border: 0; border-radius: 11px;
    font-size: 15px; font-weight: 600; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, var(--t-brand), var(--t-brand-dark));
    box-shadow: 0 12px 22px -12px rgba(184, 85, 48, .9);
    transition: transform .12s ease, box-shadow .15s ease, opacity .15s;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 26px -12px rgba(184, 85, 48, .95); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.auth-btn--alt { background: linear-gradient(135deg, #2bb673, #1e8c5a); box-shadow: 0 12px 22px -12px rgba(30, 140, 90, .9); }

.auth-link { color: var(--t-brand); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-back { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--t-muted); }

/* ---------- Alerts ---------- */
.auth-alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 11px; font-size: 13.5px; line-height: 1.4; margin-bottom: 18px; }
.auth-alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.auth-alert--error { background: var(--t-danger-bg); color: var(--t-danger); }
.auth-alert--success { background: var(--t-success-bg); color: var(--t-success); }
.auth-alert a { color: inherit; font-weight: 700; }

/* ---------- OTP helpers ---------- */
.auth-otp-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--t-muted); }
.auth-otp-sent { text-align: center; font-size: 13.5px; color: var(--t-muted); margin: 0 0 14px; }
.auth-otp-sent strong { color: var(--t-ink); }
.auth-spin { animation: auth-rotate .8s linear infinite; }
@keyframes auth-rotate { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.auth-foot { position: relative; z-index: 1; margin: 22px 0 0; text-align: center; color: var(--t-muted); font-size: 12.5px; }
.auth-foot a { color: var(--t-brand); text-decoration: none; font-weight: 600; }

/* ---------- Misc ---------- */
.auth-hint { text-align: center; font-size: 12.5px; color: var(--t-muted); margin-top: 20px; }

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem 1.25rem; border-radius: 14px; }
    .auth-leaf--1, .auth-leaf--3 { display: none; }
}
