@import url("./session-loading.css?v=2026-10-11-1");

/* Login uses the same palette, decoration and primary button as home.css. */
body.login-page {
    --login-background: #fff;
    padding: 0;
    background: var(--login-background);
}

/* Larger, offset bubbles distinguish sign-in from the home screen. */
.login-page .login-decoration::before {
    width: 240px;
    height: 240px;
    left: auto;
    right: -125px;
    top: -90px;
    transform: rotate(-20deg);
    opacity: 0.3;
}
.login-page .login-decoration::after {
    width: 180px;
    height: 180px;
    left: -120px;
    right: auto;
    top: auto;
    bottom: 95px;
    transform: rotate(20deg);
    opacity: 0.24;
}
.login-page .home-wave { height: 75px; transform: scaleX(-1); }

.login-page .login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(60px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.login-page .logo h1 { margin-top: 14px; margin-bottom: 0; }
.login-page .subtitle { margin-bottom: 22px; }
.login-page .form-group { margin-bottom: 6px; text-align: left; }
.login-page .form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--home-blue);
    font-size: 14px;
    font-weight: 650;
}
.login-page .form-group input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #f7d9c7;
    border-radius: 12px;
    background: #fff;
    color: var(--home-blue);
    font: inherit;
    font-size: 16px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.login-page .form-group input::placeholder { color: var(--home-muted); }
.login-page .form-group input:focus {
    outline: none;
    border-color: var(--home-accent);
    box-shadow: 0 0 0 3px #4264e91f;
}

.login-page .password-field { position: relative; }
.login-page #password { padding-right: 60px; }
.login-page #togglePassword {
    position: absolute;
    right: 5px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    /* Global touch gestures set inline scale(); this control must stay still. */
    transform: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 10px;
    color: #647391;
    line-height: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, background-color 160ms ease;
}
.login-page #togglePassword svg { width: 22px; height: 22px; flex: none; pointer-events: none; }
.login-page #togglePassword .password-eye-open { display: none; }
.login-page #togglePassword[aria-pressed="true"] .password-eye-open { display: block; }
.login-page #togglePassword[aria-pressed="true"] .password-eye-closed { display: none; }
.login-page #togglePassword[aria-pressed="true"] { color: var(--home-accent); }
.login-page #togglePassword:active,
.login-page #togglePassword.touch-active { background: #4264e90d; }
@media (hover: hover) {
    .login-page #togglePassword:hover { color: var(--home-accent); background: #4264e90d; }
}
.login-page .field-action-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: fit-content;
    max-width: 100%;
    min-height: 27px;
    margin: 0 0 0 auto;
    padding: 4px 0;
    background: none;
    border: none;
    color: #315ed1;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
}
.login-page .field-action-link:hover { text-decoration: underline; }
.login-page .login-btn { border: none; font-family: inherit; cursor: pointer; }
.login-page #loginBtn { margin-top: 16px; }
.login-page .login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.login-page button:focus-visible {
    outline: 3px solid var(--home-accent);
    outline-offset: 4px;
}

.login-page .back-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 14px;
    color: #315ed1;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.login-page .back-home:hover { text-decoration: underline; }
.login-page .error-message,
.login-page .success-message {
    display: none;
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid;
    border-radius: 12px;
    text-align: left;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.login-page .error-message { background: #fff0ed; border-color: #edc2b9; color: #a33a32; }
.login-page .success-message { background: #edf7ef; border-color: #bddbc4; color: #286040; }
.login-page .loading { display: none; color: var(--home-muted); margin-top: 14px; font-size: 14px; }
.login-page #resendVerifyWrap { margin-bottom: 18px; }
.login-page #resendVerifyBtn { font-size: 13px; }

.login-page .login-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    background: #06377f66;
    overflow-y: auto;
}
.login-page .login-dialog-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    max-height: min(100%, 90vh);
    max-height: min(100%, 90dvh);
    padding: 24px;
    border: 1px solid #f7d9c7;
    border-radius: 16px;
    background: var(--login-background);
    box-shadow: 0 20px 40px #06377f26;
    text-align: left;
    overflow: hidden;
}
.login-page .login-dialog h3 { margin: 0 0 8px; color: var(--home-blue); }
.login-page .login-dialog p { margin: 0 0 18px; color: var(--home-muted); font-size: 14px; }
.login-page .dialog-actions { display: flex; gap: 10px; margin-top: 12px; }
.login-page .dialog-actions .login-btn { flex: 1; padding: 12px; margin-top: 16px;}
.login-page #cancelResetBtn {
    background: #fff;
    border: 1px solid #c9c8e4;
    color: var(--home-blue);
    box-shadow: none;
}
.login-page #resetStatus { margin-top: 12px; font-size: 14px; overflow-wrap: anywhere; }

.login-page #autostartPasskeySpinner {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;
    padding: clamp(64px, 12vh, 120px) 24px max(24px, env(safe-area-inset-bottom));
    background: var(--login-background);
    color: var(--home-blue);
    text-align: center;
}
.login-page .ph-passkey-badge { width: clamp(104px, 28vw, 144px); }
.login-page .ph-passkey-badge img { display: block; width: 100%; height: auto; object-fit: contain; }
.login-page .ph-passkey-thanks { max-width: 32ch; font-size: clamp(18px, 4.4vw, 22px); font-weight: 700; }
.login-page .ph-passkey-status { color: var(--home-muted); font-size: 15px; font-weight: 600; }
html.ph-passkey-login-previsual .login-page #autostartPasskeySpinner { display: flex; }
html.ph-passkey-login-previsual,
html.ph-passkey-login-previsual body { overflow: hidden; }

@media (min-width: 600px) {
    .login-page .login-container { padding-top: 36px; padding-bottom: 64px; }
    .login-page .home-wave { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-page .form-group input { transition: none; }
}
