/* ====== AUTH PAGE LAYOUT ======
   Shared shell for Login / ForgotPassword / ResetPassword / VerifyEmail /
   VerifyPhone / TwoFactor. Each page just sets its own page-wrapper class
   (e.g. .login-page) and adds its own page-specific bits. Hero gradient,
   logo header, content padding, and input field shapes all live here. */
.login-page,
.forgot-page,
.reset-page,
.verify-page,
.tfa-page,
.complete-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: var(--bg-page);
    /* Whole page scrolls (hero + content together) — the hero holds no critical
       info, so it scrolls away on short/zoomed viewports. Page-root height is
       overridden to 100dvh/--app-zoom in utilities.css so it fits the zoomed
       viewport instead of overflowing the body and clipping the bottom. */
    overflow-y: auto;
}

.hero {
    background: linear-gradient(145deg, var(--header-grad-start) 0%, var(--header-grad-mid) 60%, var(--header-grad-end) 100%);
    padding: max(40px, var(--safe-area-top) + 12px) 24px 36px;
    position: relative;
    /* The page is one scroll container (hero + content together), so the hero must
       keep its natural height — without this the flex column shrinks it to fit the
       viewport, and the overflow:hidden below then clips the logo/close button off
       the top. Let the page scroll instead of squashing the header. */
    flex-shrink: 0;
    /* Clip the decorative circles to the hero — ::after sits at bottom:-20px and
       would otherwise spill into the body below the header. */
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.logo-badge {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.hero h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    /* Blazor enhanced nav auto-focuses h1 for screen readers; suppress the
       default focus ring so it doesn't show as a stray outline on page load. */
    outline: none;
    border: none;
}

.hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 8px;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Content container — vertical stack of form/sections below the hero. */
.login-page > .content,
.forgot-page > .content,
.reset-page > .content,
.verify-page > .content,
.tfa-page > .content,
.complete-page > .content {
    flex: 1;
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Cap + centre on wide screens so the form lines up with the rest of the app
       frame and never slides under the wide-screen gutter frost. width:100% so the
       flex item stretches to the cap; margin auto centres it. No-op below 880. */
    width: 100%;
    max-width: var(--frame-content);
    margin-left: auto;
    margin-right: auto;
}

/* Wide-screen: keep the hero gradient full-bleed (like the header bar) but cap its
   content to the frame's chrome width so the logo/subtitle line up with the form
   and the app, instead of running edge-to-edge under the gutter frost. */
.hero > .logo-container,
.hero > h1,
.hero > p {
    max-width: var(--frame-chrome);
    margin-left: auto;
    margin-right: auto;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeUp 0.3s ease;
}

/* The consent sentence that stands directly above a submit button (register tab,
   Lengkapi akun). Consent is implied by pressing the button below it, so it is read
   BEFORE the press: keep it above the button, never below. Same type as .footer p. */
.consent-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.consent-note a {
    color: var(--blue-primary);
    font-weight: 600;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-wrapper {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--field-border-color, var(--border));
    border-radius: var(--field-radius, 10px);
    overflow: visible;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--field-fill, var(--bg-white));
}

.input-wrapper:focus-within {
    border-color: var(--field-focus-border-color, var(--blue-primary));
    background: var(--field-focus-fill, var(--bg-white));
    box-shadow: var(--field-focus-shadow, 0 0 0 3px rgba(21,101,192,0.1));
}
/* Mouse hover mirrors the keyboard-focus cue (same blue border + glow); guarded
   so a touch tap doesn't leave it lit. */
@media (hover: hover) {
    .input-wrapper:hover {
        border-color: var(--field-focus-border-color, var(--blue-primary));
        background: var(--field-focus-fill, var(--bg-white));
        box-shadow: var(--field-focus-shadow, 0 0 0 3px rgba(21,101,192,0.1));
    }
}

.input-icon {
    padding: 0 14px 0 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    /* Match the wrapper's rounded corners so the autofill fill (and its inset
       box-shadow below) follows the curve instead of poking square corners past
       the rounded border. Harmless for inputs that sit flush against a prefix/
       icon — those corners are interior and share the wrapper background. */
    border-radius: inherit;
    padding: 13px 14px 13px 16px;
    font-size: 15px;
    line-height: 1.2;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    /* The referral fields uppercase what the user types (codes are uppercase); the
       placeholder is a sentence and must not shout along with it. */
    text-transform: none;
}

/* Browser-autofill rounded-corner + recolour fix is global — see the
   input:-webkit-autofill rule in base.css (covers every form, not just auth). */

.input-wrapper input::-ms-reveal,
.input-wrapper input::-webkit-credentials-auto-fill-button {
    display: none;
}
