:root {
    --ink: #16344e;
    --muted: #596e80;
    --accent: #103353;
    --line: #dbe5ed;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(ellipse at top left, #dfedf7, transparent 55%), #f6f9fc;
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-underline-offset: 4px; }
button, input { font: inherit; touch-action: manipulation; }
:focus-visible { outline: 3px solid #2878b5; outline-offset: 4px; }
.menu-login { border-bottom: 1px solid var(--line); background: #ffffffd9; }
.menu-login ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    list-style: none;
    margin: 0 auto;
    padding: 18px 16px;
}
.menu-login a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.menu-login a:hover, .menu-login a[aria-current="page"] { background: #eaf1f7; color: var(--accent); }
.login-wrapper { width: min(100%, 492px); margin: auto; padding: 32px 16px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 20px 60px #1033530d; }
.login-header { padding: 32px 32px 0; text-align: center; }
.brand-logo { width: 174px; max-width: 100%; height: auto; margin-bottom: 24px; }
.clinic-name { margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -.035em; }
.clinic-subtitle { color: var(--muted); font-size: 14px; }
.login-body { padding: 28px 32px; }
.login-method-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin-bottom: 26px; background: #edf3f8; border-radius: 12px; }
.method-btn { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.method-btn:hover { color: var(--accent); background: #e1ebf3; }
.method-btn.active { color: var(--accent); background: #fff; box-shadow: 0 2px 6px #10335314; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.form-label i { display: none; }
.input-group { flex-wrap: nowrap; }
.input-group-text { background: #f6f9fc; color: #71879a; border-color: var(--line); border-radius: 10px; padding-inline: 14px; }
.form-control { min-width: 0; min-height: 48px; border-color: var(--line); border-radius: 10px; color: var(--ink); font-size: 16px; }
.form-control::placeholder { color: #738494; font-size: 14px; }
.form-control:focus { border-color: #7ba4c4; box-shadow: 0 0 0 3px #2878b51a; }
.password-toggle { min-width: 46px; border: 1px solid var(--line); border-radius: 0 10px 10px 0; background: #f6f9fc; color: var(--muted); }
.password-toggle:hover { background: #eaf1f7; }
.remember-section { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 24px 0; font-size: 13px; }
.form-check { margin: 0; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.forgot-link { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.btn-login, .btn-back { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; }
.btn-login { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.btn-login:hover { background: #0b263e; }
.btn-back { margin-top: 12px; color: var(--muted); }
.btn-back:hover { color: var(--accent); background: #f6f9fc; }
.login-footer { padding: 18px 24px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 12px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f6f9fc; }
.pin-dot { width: 14px; height: 14px; border: 2px solid #b8cbd9; border-radius: 50%; }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); }
.pin-dot.active { border-color: #2878b5; box-shadow: 0 0 0 4px #2878b51a; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-key { min-height: 52px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 22px; font-weight: 600; }
.pin-key:hover { background: #edf3f8; border-color: #9ebcd2; }
.pin-key:active { background: #dfedf7; }
.pin-key.clear, .pin-key.backspace { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: #f6f9fc; color: var(--muted); font-size: 16px; }
.key-label { font-size: 10px; font-weight: 400; }
.pin-error { color: #b42318; font-size: 13px; margin: 8px 0; }
.alert { font-size: 14px; border-radius: 10px; overflow-wrap: anywhere; }
.alert-error { background: #fff1f0; border-color: #f4c7c3; color: #b42318; }
.errorlist { list-style: none; padding: 0; margin: 0; }
.auth-description { margin: 0 0 20px; font-size: 14px; overflow-wrap: anywhere; }
.auth-section-title { margin: 0 0 16px; font-size: 18px; font-weight: 600; }
.auth-note { margin: 8px 0 20px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.auth-note ul { padding-left: 20px; margin-bottom: 0; }
.auth-field-error { color: #b42318; font-size: 13px; margin-top: 8px; }
.auth-code { text-align: center; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.auth-actions .btn-back { border: 1px solid var(--line); background: transparent; }
.auth-actions .btn-back:hover { background: #f6f9fc; }
.auth-spacing { margin-top: 20px; }
@media (max-width: 480px) {
    .menu-login ul { gap: 4px; padding: 12px 8px; }
    .menu-login a { padding: 8px; font-size: 12px; }
    .menu-login i { display: none; }
    .login-wrapper { padding: 24px 12px; }
    .login-header { padding: 26px 20px 0; }
    .login-body { padding: 24px 20px; }
    .login-card { border-radius: 18px; }
}