/* Login and register pages (layouts/auth.blade.php). Kept separate from style.css. */
.auth{
    --ink: #14202e;
    --muted: #5d6877;
    --line: #dde2e8;
    --field: #f6f8fa;
    --brand: #1860a5;
    --brand-dark: #124c84;
    --panel: #0f2e4f;
    --danger: #b64739;

    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #fff;
    color: var(--ink);
}

/* ---------- brand panel (desktop) ---------- */
.auth-panel{
    flex: 0 0 44%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    background-color: var(--panel);
    background-image: repeating-radial-gradient(circle at 100% 100%, transparent 0, transparent 46px, rgba(255,255,255,0.05) 47px, transparent 48px);
    color: #fff;
}
.auth-panel-logo{
    width: 160px;
}
.auth-panel-copy h2{
    font-family: 'Alata', sans-serif;
    font-size: 38px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 18px 0;
    max-width: 460px;
}
.auth-panel-copy p{
    font-size: 17px;
    line-height: 1.55;
    color: rgba(255,255,255,0.72);
    max-width: 400px;
    margin: 0;
}
.auth-panel-foot{
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

/* ---------- form column ---------- */
.auth-main{
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 24px 48px 24px;
}
/* on desktop the bar only carries the Join us link, the logo lives in the panel */
.auth-bar{
    position: absolute;
    top: 28px;
    right: 32px;
}
.auth-bar-logo, .auth-foot{
    display: none;
}
.auth-bar-link{
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand);
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: border-color 0.15s, background-color 0.15s;
}
.auth-bar-link:hover{
    color: var(--brand);
    text-decoration: none;
    border-color: #b9c2cd;
    background-color: var(--field);
}
.auth-card{
    width: 100%;
    max-width: 420px;
}
.auth-card h1{
    font-family: 'Alata', sans-serif;
    font-size: 32px;
    letter-spacing: -0.01em;
    margin: 0 0 6px 0;
    color: var(--ink);
}
.auth-sub{
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 28px 0;
}
.auth-sub a{
    color: var(--brand);
    font-weight: 600;
}

.auth-alert{
    border-left: 3px solid var(--danger);
    background-color: #fbf1ef;
    color: #7d2c22;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 22px;
}

/* SSO */
.auth-sso{
    display: grid;
    gap: 10px;
}
.auth-sso a{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: #fff;
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}
.auth-sso a:hover{
    border-color: #b9c2cd;
    background-color: var(--field);
    color: var(--ink);
    text-decoration: none;
}
.auth-sso img{
    height: 18px;
}
.auth-sso-note{
    margin: 10px 0 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.auth-divider{
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 22px 0;
    color: var(--muted);
    font-size: 14px;
}
.auth-divider::before, .auth-divider::after{
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--line);
}

/* fields */
.auth-field{
    margin-bottom: 18px;
}
.auth-field label{
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--ink);
}
.auth-field input{
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--field);
    color: var(--ink);
    font-size: 16px; /* 16px stops iOS zooming on focus */
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.auth-field input:focus{
    outline: none;
    background-color: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(24,96,165,0.16);
}
.auth-password{
    position: relative;
}
.auth-password input{
    padding-right: 68px;
}
.auth-reveal{
    position: absolute;
    top: 0;
    right: 4px;
    height: 48px;
    padding: 0 12px;
    border: none;
    background: none;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.auth-reveal:focus-visible{
    outline: 2px solid var(--brand);
    outline-offset: -6px;
    border-radius: 8px;
}
.auth-hint{
    font-size: 14px;
    color: var(--muted);
    margin-top: 6px;
}
.auth-error{
    display: none;
    font-size: 14px;
    color: var(--danger);
    margin-top: 6px;
}
.was-validated .auth-field input:invalid{
    border-color: var(--danger);
}
.was-validated .auth-field input:invalid ~ .auth-error{
    display: block;
}
.was-validated .auth-field input:invalid ~ .auth-hint{
    display: none;
}

.auth-check{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0 0;
    font-size: 15px;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
}
.auth-check input{
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
}
.auth-note{
    font-size: 14px;
    color: var(--muted);
    margin-top: 6px;
    padding-left: 28px;
}

.auth-submit{
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 24px;
    border: none;
    border-radius: 10px;
    background-color: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.15s;
}
.auth-submit:hover{
    background-color: var(--brand-dark);
}
.auth-submit:focus-visible{
    outline: 3px solid rgba(24,96,165,0.35);
    outline-offset: 2px;
}

.auth-switch{
    margin: 28px 0 0 0;
    line-height: 1.6;
    text-align: center;
    font-size: 15px;
    color: var(--muted);
}
.auth-switch a{
    color: var(--brand);
    font-weight: 600;
}

.auth-row{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* segmented radio group (gender) */
.auth-segment{
    border: none;
    padding: 0;
    min-width: 0;
}
.auth-segment legend{
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--ink);
}
.auth-segment-options{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--field);
}
.auth-segment-options label{
    position: relative;
    margin: 0;
    cursor: pointer;
}
.auth-segment-options input{
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.auth-segment-options span{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 7px;
    font-size: 15px;
    color: var(--muted);
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.auth-segment-options input:checked + span{
    background-color: #fff;
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(20,32,46,0.12), 0 0 0 1px var(--line);
}
.auth-segment-options input:focus-visible + span{
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
.was-validated .auth-segment:has(:invalid) .auth-segment-options{
    border-color: var(--danger);
}
.was-validated .auth-segment:has(:invalid) .auth-error{
    display: block;
}

/* ---------- tablet and phone ---------- */
@media screen and (max-width: 900px){
    .auth-panel{
        display: none;
    }
    .auth-main{
        justify-content: flex-start;
        padding: 0;
    }
    .auth-bar{
        position: static;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: calc(env(safe-area-inset-top) + 14px) 20px 14px 20px;
        border-bottom: 1px solid var(--line);
    }
    .auth-bar-logo{
        display: block;
        width: 118px;
    }
    .auth-bar-link{
        padding: 8px 14px;
    }
    .auth-card{
        padding: 36px 20px 0 20px;
        max-width: 460px;
    }
    .auth-foot{
        display: block;
        margin-top: auto;
        padding: 28px 20px calc(env(safe-area-inset-bottom) + 16px) 20px;
        font-size: 13px;
        color: var(--muted);
    }
}
@media screen and (max-width: 480px){
    .auth-row{
        grid-template-columns: 1fr;
        gap: 0;
    }
}
@media screen and (max-width: 380px){
    .auth-card{
        padding-top: 28px;
    }
    .auth-card h1{
        font-size: 28px;
    }
}
