﻿* { box-sizing: border-box; }
:root { color-scheme: light; font-family: Arial, "Noto Sans Armenian", sans-serif; color: #344549; background: #fff; }
body { margin: 0; }
main { width: 100%; max-width: 588px; min-height: 100svh; margin: auto; padding: max(30px, env(safe-area-inset-top)) 24px max(84px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 22px; min-height: 42px; font-size: 29px; font-weight: 700; }
button, input { font: inherit; }
.back { border: 0; background: none; color: inherit; padding: 0; width: 32px; font-size: 37px; line-height: 1; cursor: pointer; }
#form { display: flex; flex: 1; flex-direction: column; }
.intro { text-align: center; margin: 30px 0 58px; }
.intro h1 { font-size: 23px; line-height: 1.4; margin: 0 0 10px; font-weight: 700; }
.intro p { font-size: 20px; line-height: 1.45; color: #7a8186; margin: 0; }
label { display: block; font-size: 17px; font-weight: 700; line-height: 24px; margin-bottom: 4px; }
input { width: 100%; height: 74px; border: 1px solid transparent; border-radius: 20px; background: #f5f6f6; color: #344549; padding: 0 22px; outline: none; font-size: 20px; }
input::placeholder { color: #b9bdbd; opacity: 1; }
input:focus { border-color: #fa8069; box-shadow: 0 0 0 2px #fff0eb; }
.hint { margin: 13px 0 0; font-size: 16px; line-height: 24px; color: #788187; }
.note { display: flex; align-items: flex-start; gap: 13px; margin-top: 24px; font-size: 17px; line-height: 22px; color: #7c8589; }
.note b { flex-shrink: 0; color: #fa8069; font-size: 23px; font-weight: 400; }
.error { color: #be4435; font-size: 15px; line-height: 1.5; margin: 14px 0; }
.error:empty { display: none; }
.footer { margin-top: auto; padding-top: 42px; text-align: center; }
.consent { margin: 0 15px 30px; font-size: 18px; line-height: 1.35; }
.consent strong { display: block; color: #fa755e; font-size: 20px; margin-bottom: 5px; }
.primary { width: 100%; min-height: 70px; border: 0; border-radius: 40px; background: #fa8069; color: white; font-size: 19px; font-weight: 700; display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px 18px; cursor: pointer; }
.primary:disabled { cursor: default; background: #eceff0; color: #9ca6aa; }
.spinner { width: 22px; height: 22px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.success { text-align: center; margin: auto 0; outline: none; }
.new-application { display: inline-block; margin-top: 18px; color: #bf503b; text-underline-offset: 4px; }
.success h1 { font-size: 25px; }
.success p { color: #778185; line-height: 1.6; }
.check { width: 78px; height: 78px; border-radius: 50%; background: #edf8f1; color: #329b65; display: grid; place-items: center; margin: 0 auto 25px; font-size: 36px; }
.hidden { display: none !important; }
.waiting { margin: auto 0; padding: 48px 0; text-align: center; outline: none; }
main:has(#waiting:not(.hidden)) header { display: none; }
.waiting h1 { font-size: 23px; margin: 28px 0 12px; }
.waiting p { color: #7a8186; font-size: 17px; line-height: 1.5; }
.waiting-spinner { width: 54px; height: 54px; margin: auto; border: 3px solid #ffdfd5; border-top-color: #fa8069; border-radius: 50%; animation: spin 1s linear infinite; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 430px) {
  main { padding: max(22px, env(safe-area-inset-top)) 16px max(42px, env(safe-area-inset-bottom)); }
  header { font-size: 23px; gap: 16px; }
  .intro { margin: 24px 0 40px; }
  .intro h1 { font-size: 21px; }
  .intro p { font-size: 16px; }
  input { height: 60px; border-radius: 16px; padding: 0 16px; font-size: 17px; }
  label, .hint { font-size: 14px; }
  .note { font-size: 14px; line-height: 20px; gap: 10px; margin-top: 20px; }
  .consent { font-size: 14px; margin: 0 8px 24px; }
  .consent strong { font-size: 17px; }
  .primary { min-height: 56px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .spinner, .waiting-spinner { animation-duration: 1.8s; } }
/* Residence year keypad */
main:has(.residence-mode) { padding: 0; background: #fdfdfd; }
body:has(.residence-mode) { background: #fdfdfd; }
main:has(.residence-mode) header { display: none; }
.residence-mode .intro { margin: 0; padding: max(8px, env(safe-area-inset-top)) 20px 0; }
.residence-mode .intro h1 { font-size: 16px; font-weight: 400; margin: 0 0 8px; }
.residence-mode .intro p { font-size: 12px; line-height: 1.5; }
.residence-mode #residenceStep > label { display: none; }
.residence-mode #residenceStep { display: flex; flex: 1; flex-direction: column; }
.year-dots { display: flex; justify-content: center; gap: 30px; padding: 32px 0; }
.year-dots span { width: 11px; height: 11px; border-radius: 50%; background: #a8b5ba; transition: background .12s, transform .12s; }
.year-dots span.filled { background: #344549; transform: scale(1.15); }
.year-keypad { margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: #d1d4da; padding: 6px 3px max(48px, env(safe-area-inset-bottom)); }
.year-key { min-height: 46px; padding: 3px 0; border: 0; border-radius: 5px; background: #fff; color: #111; box-shadow: 0 1px 1px #999; cursor: pointer; }
.year-key > span { display: block; font-size: 26px; line-height: 27px; }
.year-key small { display: block; font-size: 9px; line-height: 11px; font-weight: 600; letter-spacing: 2px; }
.year-delete { border: 0; background: transparent; color: #111; font-size: 27px; cursor: pointer; }
.year-key:active, .year-delete:active { background: #b8c0c7; }
.year-key:focus-visible, .year-delete:focus-visible { outline: 2px solid #344549; outline-offset: -2px; }
.residence-mode .footer { margin: 0; padding: 0; }
.residence-mode .consent, .residence-mode .primary { display: none; }
.residence-mode > .error { order: -1; text-align: center; padding: 0 16px; }

.residence-logo { display: none; }
.residence-mode .residence-logo { display: block; width: 220px; max-width: 70%; height: auto; margin: max(12px, env(safe-area-inset-top)) auto 0; }
