/* ──────────────────────────────────────────────────────────────────────────
   Auth pages (login + register) — split brand panel layout.

   Left: a deep-green panel with a slow animated gradient (no image, so there
   is nothing to upload, nothing to load and nothing to go stale).
   Right: the form card on a calm off-white field.
   Below 1024px the panel collapses into a short header strip above the card.
   ────────────────────────────────────────────────────────────────────────── */

:root {
    --auth-green-900: #06281c;
    --auth-green-800: #0b3d2c;
    --auth-green-700: #115e43;
    --auth-teal-600:  #0f766e;
    --auth-lime-400:  #a3e635;
    --auth-surface:   #f6f7f5;
}

/* ── Shell ─────────────────────────────────────────────────────────────── */
.auth-shell {
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    min-height: calc(100vh - 80px);
    background: var(--auth-surface);
}

/* ── Brand panel ───────────────────────────────────────────────────────── */
.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.75rem;
    padding: 3.5rem 3rem;
    color: #fff;
    background: linear-gradient(150deg, var(--auth-green-900) 0%, var(--auth-green-800) 45%, var(--auth-green-700) 100%);
    isolation: isolate;
}

/* Two drifting colour pools. They are large, soft and slow, so the panel
   looks alive without ever pulling attention off the form. */
.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    z-index: -1;
    pointer-events: none;
}
.auth-brand::before {
    width: 46vw;
    height: 46vw;
    max-width: 620px;
    max-height: 620px;
    top: -14%;
    left: -12%;
    background: radial-gradient(circle at 50% 50%, var(--auth-teal-600), transparent 68%);
    animation: authDriftA 22s ease-in-out infinite alternate;
}
.auth-brand::after {
    width: 38vw;
    height: 38vw;
    max-width: 520px;
    max-height: 520px;
    bottom: -16%;
    right: -10%;
    background: radial-gradient(circle at 50% 50%, #1f9d55, transparent 70%);
    animation: authDriftB 28s ease-in-out infinite alternate;
}
@keyframes authDriftA {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(9%, 12%, 0) scale(1.14); }
}
@keyframes authDriftB {
    from { transform: translate3d(0, 0, 0) scale(1.08); }
    to   { transform: translate3d(-11%, -9%, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-brand::before,
    .auth-brand::after { animation: none; }
}

/* A fine grid over the gradient, for texture rather than decoration. */
.auth-brand-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 72%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 72%);
}

.auth-brand-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
}
.auth-brand-mark .auth-brand-dot {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 1.05rem;
}
.auth-brand-mark small {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.72;
    margin-top: 0.15rem;
}

.auth-brand-copy h2 {
    font-size: clamp(1.8rem, 2.4vw, 2.6rem);
    line-height: 1.15;
    margin: 0 0 0.85rem 0;
    font-weight: 700;
    color: #fff;
}
.auth-brand-copy h2 em {
    font-style: normal;
    color: var(--auth-lime-400);
}
.auth-brand-copy p {
    margin: 0;
    max-width: 38ch;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.auth-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.auth-points li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.86);
}
.auth-points i {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    background: rgba(163, 230, 53, 0.16);
    color: var(--auth-lime-400);
}

/* ── App store badges ──────────────────────────────────────────────────── */
.app-store-cta {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.app-store-cta .app-store-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}
.app-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.95rem 0.5rem 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    background: #0f172a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}
.app-badge:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22); }
.app-badge:active { transform: translateY(0); }
.app-badge .badge-title { font-size: 0.86rem; line-height: 1.1; }
.app-badge .badge-sub { font-size: 0.62rem; opacity: 0.78; font-weight: 600; letter-spacing: 0.02em; }
.app-badge svg { width: 22px; height: 22px; flex-shrink: 0; }
/* Store links come from settings; a badge without one opens the
   "coming soon" note, so show it as not yet live. */
.app-badge:not([data-has-link]) { opacity: 0.6; }

/* On the dark panel the badges are glass, not black on black. */
.auth-brand .app-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.26);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.auth-brand .app-badge:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Form side ─────────────────────────────────────────────────────────── */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--auth-surface);
}
.auth-panel-inner {
    width: 100%;
    max-width: 440px;
}
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    background: #fff;
    border: 1px solid #e6e8e4;
    border-radius: 20px;
    padding: 2.25rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 18px 46px -18px rgba(6, 40, 28, 0.28);
}
.auth-header {
    margin-bottom: 1.5rem;
}
.auth-header h1 {
    font-size: 1.65rem;
    line-height: 1.2;
    margin: 0 0 0.35rem 0;
    color: #0f172a;
    font-weight: 700;
}
.auth-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.93rem;
}

/* Inputs inherit the site styles; these give them the calmer auth look. */
.auth-card .form-input {
    background: #fbfbfa;
    border: 1.5px solid #e2e5df;
    border-radius: 11px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-card .form-input:focus {
    background: #fff;
    border-color: var(--auth-green-700);
    box-shadow: 0 0 0 3px rgba(17, 94, 67, 0.12);
    outline: none;
}
.auth-card .form-label {
    color: #344054;
    font-weight: 600;
    font-size: 0.86rem;
}

/* Google / phone alternatives, under a labelled divider. */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
    color: #98a2b3;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e6e8e4;
}

.login-alt-buttons,
.register-alt-buttons {
    position: relative;
    z-index: 3;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem !important;
}
.login-alt-buttons > button,
.register-alt-buttons > button {
    justify-content: center;
    width: 100%;
    background: #fff !important;
    border: 1.5px solid #e2e5df !important;
    border-radius: 11px !important;
    padding: 0.6rem 0.75rem !important;
    font-weight: 600 !important;
    color: #344054;
    box-shadow: none !important;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.login-alt-buttons > button:hover,
.register-alt-buttons > button:hover {
    border-color: #cfd4ca !important;
    background: #fafbf9 !important;
}

.auth-switch {
    text-align: center;
    margin-top: 1.4rem;
    font-size: 0.9rem;
    color: #64748b;
}
.auth-switch a {
    color: var(--auth-green-700);
    font-weight: 700;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* Mobile badge row, under the card — hidden while the panel shows its own. */
.app-badges-mobile {
    display: none;
    margin-top: 1.25rem;
    justify-content: center;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .auth-brand {
        padding: 1.75rem 1.5rem;
        gap: 1rem;
    }
    .auth-brand-copy h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
    .auth-brand-copy p { font-size: 0.9rem; max-width: none; }
    .auth-points,
    .auth-brand .app-store-cta { display: none; }
    .auth-panel { padding: 1.5rem 1rem 2.5rem; }
    .app-badges-mobile { display: flex; }
}

@media (max-width: 560px) {
    .auth-brand { padding: 1.4rem 1.15rem; }
    .auth-brand-mark { font-size: 1rem; }
    .auth-brand-copy h2 { font-size: 1.3rem; }
    .auth-card { padding: 1.35rem 1.15rem; border-radius: 16px; }
    .auth-header h1 { font-size: 1.35rem; }
    /* Side by side leaves no room for the labels on a narrow phone. */
    .login-alt-buttons,
    .register-alt-buttons { grid-template-columns: 1fr; }
    .app-badges-mobile { flex-wrap: wrap; }
}
