/* ==========================================================
   Roommate Finder: auth pages (login + register)
   Self-contained. Does not depend on Tailwind or Vite.
   ========================================================== */

/* Colours come from brand.css (load it first). */

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

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

body.auth {
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(340px, 5fr) 7fr;
    min-height: 100vh;
}

.auth-side {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: var(--paper);
    background: var(--pine);
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--paper);
    text-decoration: none;
}

.auth-brand-logo {
    display: block;
    height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.auth-pitch {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.auth-pitch h2 {
    margin: 0 0 16px;
    font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 3.6vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.auth-pitch p {
    margin: 0;
    max-width: 34ch;
    color: color-mix(in srgb, var(--paper) 70%, var(--pine));
}

.auth-plan {
    position: absolute;
    right: -60px;
    bottom: -40px;
    width: 460px;
    max-width: 90%;
    color: var(--pine-line);
    pointer-events: none;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

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

.auth-panel--wide {
    max-width: 520px;
}

/* ---------- Headings ---------- */

.auth-panel h1 {
    margin: 0 0 6px;
    font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.auth-lede {
    margin: 0 0 32px;
    color: var(--muted);
}

/* ---------- Form ---------- */

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="url"],
.field select {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235d6f6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.field input:hover,
.field select:hover {
    border-color: #a9bab5;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--pine);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pine) 16%, transparent);
}

.field input::placeholder {
    color: #94a4a0;
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    box-shadow: 0 0 0 100px var(--white) inset;
}

.field.has-error input,
.field.has-error select {
    border-color: var(--error);
}

.field-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.field-error {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--error);
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -4px 0 24px;
    font-size: 14px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    cursor: pointer;
}

.check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--pine);
}

/* ---------- Buttons + links ---------- */

.btn {
    display: block;
    width: 100%;
    height: 48px;
    font: inherit;
    font-weight: 700;
    color: var(--white);
    background: var(--pine);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover {
    background: var(--pine-deep);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible,
.auth-panel a:focus-visible {
    outline: 3px solid var(--sun);
    outline-offset: 3px;
}

.auth-panel a {
    color: var(--pine);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.auth-panel a:hover {
    color: var(--pine-deep);
}

.auth-switch {
    margin: 24px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}

.alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--pine-deep);
    background: color-mix(in srgb, var(--pine) 10%, white);
    border-left: 4px solid var(--pine);
    border-radius: 6px;
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-side {
        padding: 20px 24px;
    }

    .auth-pitch,
    .auth-plan {
        display: none;
    }

    .auth-brand-logo {
        height: 64px;
    }

    .auth-main {
        align-items: flex-start;
        padding: 32px 24px 48px;
    }
}

@media (max-width: 480px) {
    .row-2 {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* ==========================================================
   Google sign-in button
   ========================================================== */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink);
    text-decoration: none;
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-google:hover {
    background: var(--paper);
    border-color: var(--muted);
}

.auth-or {
    position: relative;
    margin: 4px 0 20px;
    text-align: center;
}

.auth-or::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line);
}

.auth-or span {
    position: relative;
    padding: 0 12px;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--white);
}

/* ==========================================================
   v7 REDESIGN — login, sign-up and the other account pages
   (scoped to .auth-shell so the finder pages are not affected)
   ========================================================== */
.auth-shell { grid-template-columns: minmax(380px, 46fr) 54fr; }
.auth-shell .auth-side { justify-content: flex-start; gap: 34px; padding: 40px 48px; color: #fff;
    background: radial-gradient(900px 500px at 90% 0%, #1d5a53 0%, transparent 60%), linear-gradient(160deg, #0f3835 0%, #0c2e2b 60%, #0a2523 100%); }
.as-glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.as-glow--a { width: 380px; height: 380px; background: #f4b942; opacity: .14; top: -140px; left: -120px; }
.as-glow--b { width: 460px; height: 460px; background: #e4627a; opacity: .12; bottom: -200px; right: -120px; }
.auth-shell .auth-brand { color: #fff; font-size: 26px; font-weight: 800; }
.auth-shell .auth-brand-logo { height: 64px; }
.auth-shell .auth-pitch { max-width: 460px; }
.auth-shell .auth-pitch h2 { font-size: clamp(32px, 3.2vw, 46px); font-weight: 800; color: #fff; }
.auth-shell .auth-pitch p { color: rgba(255, 255, 255, .78); font-size: 17px; max-width: 40ch; }
.as-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.as-points li { position: relative; padding-left: 28px; font-weight: 600; font-size: 15px; color: #e6f3ef; }
.as-points li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12px; font-weight: 800; background: var(--sun); color: var(--pine-deep); }
.as-cards { position: relative; height: 300px; margin-top: auto; }
.as-card { position: absolute; width: 180px; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; border: 4px solid rgba(255, 255, 255, .92);
    box-shadow: 0 24px 50px rgba(0, 0, 0, .35); background: #1d4a45; }
.as-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.as-card b { position: absolute; left: 12px; bottom: 10px; color: #fff; font: 800 18px "Bricolage Grotesque", sans-serif; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.as-card--0 { left: 50%; top: 0; transform: translateX(-50%) rotate(-2deg); z-index: 3; }
.as-card--1 { left: 6%; top: 40px; transform: rotate(-10deg) scale(.86); z-index: 2; }
.as-card--2 { right: 6%; top: 36px; transform: rotate(9deg) scale(.86); z-index: 1; }
.as-chip { position: absolute; z-index: 4; left: 8%; bottom: 8px; padding: 9px 14px; border-radius: 14px; background: #fff; color: #172624; font-weight: 700; font-size: 14px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .25); animation: as-bob 5s ease-in-out infinite; }
@keyframes as-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.as-proof { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, .85); }
.as-proof b { color: #fff; }
.as-faces { display: flex; }
.as-faces img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2.5px solid #0f3835; margin-left: -10px; }
.as-faces img:first-child { margin-left: 0; }
.auth-shell .as-cards ~ .as-proof { margin-top: 0; }
.auth-shell .auth-side > .as-proof:only-of-type { margin-top: auto; }

.auth-shell .auth-main { position: relative; flex-direction: column; justify-content: center; padding: 88px 40px 56px; background: var(--paper); }
.auth-top { position: absolute; top: 22px; left: 32px; right: 32px; display: flex; align-items: center; justify-content: space-between; }
.auth-shell .auth-home { color: var(--muted); font-weight: 600; text-decoration: none; font-size: 15px; }
.auth-shell .auth-home:hover { color: var(--pine); }
.auth-shell .auth-panel { max-width: 440px; padding: 36px 34px; border-radius: 24px; background: var(--white); border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(23, 38, 36, .08); }
.auth-shell .auth-panel--wide { max-width: 600px; }
.auth-shell .auth-panel h1 { font-size: 32px; font-weight: 800; }
.auth-shell .auth-lede { margin-bottom: 26px; }
.auth-shell .field input, .auth-shell .field select { min-height: 50px; border-radius: 12px; font-size: 16px; }
.auth-shell .btn { min-height: 54px; border-radius: 14px; font-size: 17px; font-weight: 800; background: var(--pine); color: #fff;
    box-shadow: 0 10px 24px rgba(18, 64, 60, .22); }
.auth-shell .btn:hover { background: var(--pine-deep); }
.auth-shell .btn--sun { background: var(--sun); color: var(--pine-deep); box-shadow: 0 10px 24px rgba(244, 185, 66, .35); }
.auth-shell .btn--sun:hover { background: #ffc85a; }
.auth-shell .btn-google { min-height: 52px; border-radius: 14px; font-weight: 700; }

/* show / hide password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px !important; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: 8px; background: transparent;
    color: var(--pine); font: 700 13px "DM Sans", sans-serif; cursor: pointer; }
.pw-toggle:hover { background: color-mix(in srgb, var(--pine) 8%, white); }

/* sign-up: sections and gender pills */
.au-step { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font: 800 13px "DM Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--pine); }
.au-step:first-of-type { margin-top: 4px; }
.au-step i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--pine); color: var(--sun); font-style: normal; font-size: 12px; }
.au-step::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.au-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.au-pills label { position: relative; cursor: pointer; margin: 0 !important; }
.au-pills input { position: absolute; opacity: 0; inset: 0; }
.au-pills span { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line);
    background: var(--white); font-weight: 700; font-size: 15px; color: var(--ink); transition: border-color .15s, background .15s; }
.au-pills input:checked + span { border-color: var(--pine); background: color-mix(in srgb, var(--pine) 8%, white); color: var(--pine); }
.au-pills input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.au-optional { font-weight: 500; color: var(--muted); font-size: 13px; }
.au-strength { height: 5px; margin-top: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.au-strength i { display: block; height: 100%; width: 0; background: #d64545; transition: width .2s, background .2s; }
.au-terms { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.au-terms input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--pine); }
.au-alt { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.au-alt p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.au-alt a.btn-outline { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 14px; border: 2px solid var(--pine);
    color: var(--pine); font-weight: 800; text-decoration: none; }
.au-alt a.btn-outline:hover { background: color-mix(in srgb, var(--pine) 6%, white); }
.au-safe { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 16px 0 0; font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) { .as-cards { display: none; } .auth-shell .auth-side > .as-proof { margin-top: auto; } }
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-shell .auth-side { gap: 14px; padding: 18px 20px 22px; }
    .auth-shell .auth-pitch { display: block; }
    .auth-shell .auth-pitch h2 { font-size: 24px; margin-bottom: 6px; }
    .auth-shell .auth-pitch p, .as-points, .as-cards { display: none; }
    .auth-shell .auth-brand-logo { height: 44px; }
    .auth-shell .auth-brand { font-size: 22px; }
    .as-proof { font-size: 13.5px; }
    .as-faces img { width: 30px; height: 30px; }
    .auth-shell .auth-main { padding: 62px 14px 40px; justify-content: flex-start; }
    .auth-top { top: 14px; left: 16px; right: 16px; }
    .auth-shell .auth-panel { padding: 26px 20px; border-radius: 20px; }
    .auth-shell .auth-panel h1 { font-size: 27px; }
}
.auth-top .lng-switch { position: static !important; margin: 0 !important; top: auto; right: auto; }
.auth-shell .field label.au-terms { display: flex; font-weight: 400; margin: 0; }
@media (min-width: 861px) { .auth-shell { align-items: start; } .auth-shell .auth-side { position: sticky; top: 0; height: 100vh; min-height: 640px; } .auth-shell .auth-main { min-height: 100vh; } }
.auth-shell .field input[type="checkbox"], .auth-shell .field input[type="radio"] { min-height: 0; height: auto; width: 18px; padding: 0; }
