:root {
    --standalone-text: #111827;
    --standalone-muted: #6b7280;
    --standalone-brand: #0284c7;
    --standalone-brand-hover: #0369a1;
}

* { box-sizing: border-box; }
body { margin: 0; }
.standalone-body {
    font-family: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--standalone-text);
    background: #fff;
    line-height: 1.5;
}
button, input { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible {
    outline: 3px solid var(--standalone-brand);
    outline-offset: 4px;
}
.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}
.login-panel {
    display: flex;
    align-items: center;
    padding: 48px clamp(24px, 5.56vw, 80px);
    min-width: 0;
}
.login-content { width: 100%; }
.standalone-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.standalone-brand img { width: 48px; height: 48px; object-fit: contain; }
.standalone-brand strong { display: block; font-size: 20px; font-weight: 800; line-height: 1.3; }
.standalone-brand small { display: block; color: #4b5563; font-size: 14px; }
.login-intro { margin: 24px 0 60px; }
.login-intro h1 { margin: 0 0 8px; font-size: 24px; font-weight: 800; line-height: 1.35; letter-spacing: -.025em; }
.login-intro p { margin: 0; font-size: 14px; color: var(--standalone-muted); }
.login-form { display: grid; gap: 20px; }
.login-field { display: grid; gap: 4px; }
.login-field label { font-size: 14px; font-weight: 500; color: #374151; }
.login-field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: var(--standalone-text);
    background: #fff;
    font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.login-field input::placeholder { color: #94a3b8; opacity: 1; }
.login-field input:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 1px #0ea5e9; }
.password-control { position: relative; }
.password-control input { padding-right: 52px; }
.password-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; color: #4b5563; cursor: pointer; }
.password-toggle:hover { background: #f1f5f9; color: var(--standalone-brand-hover); }
.password-toggle [hidden], .password-toggle[hidden], .captcha-refresh[hidden] { display: none; }
.captcha-challenge { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 8px; }
.captcha-challenge img { display: block; max-width: 100%; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.captcha-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--standalone-brand-hover); cursor: pointer; font-size: 14px; }
.captcha-refresh:hover { background: #f0f9ff; }
.login-help { margin: 2px 0 0; color: var(--standalone-muted); font-size: 12px; }
.captcha-status:empty { display: none; }
button:disabled { opacity: .6; cursor: wait; }
.standalone-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    border: 0;
    border-radius: 8px;
    background: var(--standalone-brand);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s;
}
.standalone-button:hover { background: var(--standalone-brand-hover); }
.standalone-button:active { background: #075985; }
.login-credit { margin: 48px 0 0; font-size: 12px; color: #6b7280; text-align: center; }
.login-media { background: #0093dd url('/images/bg-login.png') center / cover no-repeat; }
.standalone-alert { margin: -36px 0 20px; padding: 12px 16px; border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; }
.standalone-alert.is-error { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.standalone-alert.is-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.error-layout {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px;
    background: #f8fafc;
}
.error-content { width: min(100%, 560px); text-align: center; }
.error-brand { text-align: left; }
.error-code { margin: 40px 0 8px; color: var(--standalone-brand); font-size: clamp(80px, 14vw, 128px); font-weight: 800; line-height: 1; letter-spacing: -.06em; }
.error-content h1 { margin: 20px 0 12px; font-size: clamp(24px, 4vw, 32px); line-height: 1.25; font-weight: 800; text-wrap: balance; }
.error-message { margin: 0 auto; max-width: 46ch; color: var(--standalone-muted); overflow-wrap: anywhere; }
.error-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 32px; }
.standalone-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--standalone-brand-hover); font-size: 14px; text-underline-offset: 4px; }
.standalone-link:hover { color: var(--standalone-text); }
@media (max-width: 1023px) {
    .login-layout { grid-template-columns: 1fr; }
    .login-panel { padding: 48px 24px; }
    .login-content { max-width: 560px; margin: auto; }
    .login-media { display: none; }
}
@media (max-width: 480px) {
    .login-panel { padding: 36px 24px; }
    .login-intro { margin-bottom: 40px; }
    .login-intro h1 { font-size: 22px; }
    .login-credit { margin-top: 36px; }
    .standalone-alert { margin-top: -20px; }
    .error-actions .standalone-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
