/* ------------------------------------------------------------------
   Parcel Count - "gate register" theme
   Warm paper, deep ink, marigold accent. Built for senior eyes:
   big type, fat tap targets, high contrast.
   Fonts: Atkinson Hyperlegible (made for low-vision readers)
          + Bricolage Grotesque for display numerals.
------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,800&display=swap');

:root {
    --paper:       #FBF3E4;
    --paper-deep:  #F3E6CE;
    --ink:         #26211A;
    --ink-soft:    #5C5344;
    --line:        #E0D2B8;
    --marigold:    #E07B00;
    --marigold-dk: #B35F00;
    --green:       #2E7D32;
    --green-deep:  #1B5E20;
    --red:         #C62828;
    --card:        #FFFDF7;
    --shadow:      0 2px 0 rgba(38, 33, 26, .14);
    --radius:      14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Atkinson Hyperlegible', Verdana, sans-serif;
    font-size: 19px;
    line-height: 1.45;
    color: var(--ink);
    background:
        repeating-linear-gradient(0deg, transparent 0 38px, rgba(38,33,26,.035) 38px 39px),
        radial-gradient(120% 90% at 50% 0%, var(--paper) 55%, var(--paper-deep) 100%);
    min-height: 100vh;
}

/* ---------- top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ink);
    color: var(--paper);
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .02em;
}
.topbar a {
    color: var(--paper);
    text-decoration: none;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 10px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}
.topbar .back   { background: rgba(255,255,255,.14); font-size: 20px; }
.topbar .logout-form { margin: 0; }
.topbar .logout {
    border: 2px solid rgba(255,255,255,.35);
    font-size: 16px;
    background: none;
    color: var(--paper);
    font-weight: 700;
    font-family: inherit;
    padding: 10px 14px;
    border-radius: 10px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* ---------- layout ---------- */
.wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 16px 48px;
}
.page-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 32px;
    margin: 10px 0 6px;
}
.page-hint {
    color: var(--ink-soft);
    margin: 0 0 18px;
    font-size: 17px;
}
.hint-center { text-align: center; margin-top: 26px; }

/* ---------- messages ---------- */
.msg {
    font-weight: 700;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin: 12px 0;
    border: 2px solid;
}
.msg-ok    { background: #E6F2E6; color: var(--green-deep); border-color: var(--green); }
.msg-error { background: #FCE9E9; color: var(--red);        border-color: var(--red);  }

/* ---------- login ---------- */
.login-page { display: grid; place-items: center; padding: 24px 16px; }
.login-wrap { width: 100%; max-width: 400px; text-align: center; }
.login-mark { font-size: 56px; margin-top: 24px; }
.login-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 52px;
    line-height: .95;
    margin: 8px 0 28px;
    letter-spacing: -.01em;
}
.login-form { text-align: left; }

.field { display: block; margin-bottom: 18px; }
.field-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 17px;
}
.field input {
    width: 100%;
    font: inherit;
    font-size: 22px;
    padding: 14px 16px;
    min-height: 58px;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
}
.field input:focus,
.otp-input:focus,
.stepper input:focus {
    outline: 4px solid var(--marigold);
    outline-offset: 2px;
}
.show-pass {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -6px 0 20px;
    font-size: 17px;
    min-height: 44px;
}
.show-pass input { width: 26px; height: 26px; accent-color: var(--marigold); }

/* ---------- buttons ---------- */
.btn {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: .02em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    min-height: 64px;
    padding: 14px 20px;
    box-shadow: 0 4px 0 rgba(0,0,0,.25);
    transition: transform .05s, box-shadow .05s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn-primary { background: var(--marigold); color: #fff; }
.btn-primary:active { background: var(--marigold-dk); }
.btn-collect { background: var(--green); color: #fff; }
.btn-collect:active { background: var(--green-deep); }
.btn-big { font-size: 24px; }

/* ---------- towers ---------- */
.tower-list { display: grid; gap: 14px; margin-top: 8px; }
.tower-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 30px;
    color: var(--ink);
    background: var(--card);
    border: 2.5px solid var(--ink);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.tower-card:active { background: var(--paper-deep); }

/* ---------- flat grid ---------- */
.flat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.flat-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    background: var(--card);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow);
}
.flat-card:active { background: var(--paper-deep); }
.flat-card.has-waiting { border-color: var(--marigold); background: #FFF4E2; }
.flat-no {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 28px;
}
.badge {
    position: absolute;
    top: -10px;
    right: -8px;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--marigold);
    color: #fff;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 19px;
    border-radius: 17px;
    box-shadow: 0 2px 0 rgba(0,0,0,.2);
}

/* ---------- cards ---------- */
.card {
    background: var(--card);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 16px;
    margin: 16px 0;
    box-shadow: var(--shadow);
}
.card-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 22px;
    margin: 0 0 14px;
}
.collect-title { margin-top: 26px; }
.empty { color: var(--ink-soft); margin: 0; font-size: 18px; }

/* ---------- stepper ---------- */
.stepper {
    display: grid;
    grid-template-columns: 76px 1fr 76px;
    gap: 10px;
    margin-bottom: 14px;
}
.step-btn {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 38px;
    min-height: 76px;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper-deep);
    color: var(--ink);
    cursor: pointer;
}
.step-btn:active { background: var(--line); }
.stepper input {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 44px;
    text-align: center;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
    width: 100%;
    -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- pending list (guard) ---------- */
.pending-list { list-style: none; margin: 0; padding: 0; }
.pending-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1.5px dashed var(--line);
}
.pending-list li:last-child { border-bottom: none; }
.p-count {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 30px;
    background: var(--paper-deep);
    border: 2px solid var(--ink);
    border-radius: 12px;
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.p-label { font-weight: 700; line-height: 1.25; }
.p-label small { color: var(--ink-soft); font-weight: 400; font-size: 15px; }

/* ---------- collect form ---------- */
.collect-form { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.otp-input {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 44px;
    text-align: center;
    letter-spacing: .1em;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
    width: 100%;
    min-height: 64px;
    padding: 4px;
}

/* ---------- resident hero ---------- */
.hero {
    border-radius: 20px;
    padding: 30px 22px;
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    gap: 22px;
    color: #fff;
    box-shadow: 0 5px 0 rgba(0,0,0,.22);
}
.hero-waiting { background: linear-gradient(150deg, var(--marigold) 0%, var(--marigold-dk) 100%); }
.hero-clear   { background: linear-gradient(150deg, var(--green) 0%, var(--green-deep) 100%); }
.hero-num {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 84px;
    line-height: 1;
    text-shadow: 0 3px 0 rgba(0,0,0,.2);
}
.hero-text { font-size: 23px; font-weight: 700; line-height: 1.3; }

/* ---------- resident OTP cards ---------- */
.otp-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    background: var(--card);
    border: 2.5px solid var(--ink);
    border-radius: var(--radius);
    padding: 16px;
    margin: 14px 0;
    box-shadow: var(--shadow);
}
.otp-meta { display: flex; align-items: center; gap: 14px; }
.otp-show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--paper);
    border-radius: 12px;
    padding: 8px 18px;
    min-width: 110px;
}
.otp-label { font-size: 13px; letter-spacing: .25em; opacity: .75; font-weight: 700; }
.otp-digits {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 54px;
    line-height: 1.05;
    letter-spacing: .06em;
}

/* ---------- history ---------- */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1.5px dashed var(--line);
    font-weight: 700;
    color: var(--green-deep);
}
.history-list li:last-child { border-bottom: none; }
.history-list small { color: var(--ink-soft); font-weight: 400; font-size: 15px; }

/* ---------- landing page ---------- */
.landing main { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }

.land-hero { padding: 44px 0 36px; }
.land-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 52px;
    line-height: 1.02;
    margin: 0 0 16px;
    letter-spacing: -.015em;
}
.land-title em {
    font-style: normal;
    color: var(--marigold);
    text-decoration: underline;
    text-decoration-thickness: 6px;
    text-underline-offset: 6px;
}
.land-tag {
    font-size: 19px;
    color: var(--ink-soft);
    margin: 0 0 26px;
    max-width: 46ch;
}
.land-cta { display: flex; align-items: center; justify-content: center; text-decoration: none; }

.land-h2 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 30px;
    margin: 44px 0 18px;
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.step-card {
    position: relative;
    background: var(--card);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px 74px;
    box-shadow: var(--shadow);
}
.step-card h3 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 21px;
    margin: 0 0 6px;
}
.step-card p { margin: 0; color: var(--ink-soft); font-size: 17px; }
.step-num {
    position: absolute;
    left: 16px;
    top: 18px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--marigold);
    color: #fff;
    border-radius: 12px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 24px;
    box-shadow: 0 3px 0 rgba(0,0,0,.18);
}

.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.why-list li {
    background: var(--card);
    border: 2.5px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 18px;
}

.land-register {
    background: var(--ink);
    color: var(--paper);
    border-radius: 20px;
    padding: 8px 20px 24px;
    margin-top: 44px;
}
.land-register .land-h2 { margin-top: 24px; color: var(--paper); }
.land-register .land-tag { color: rgba(251,243,228,.75); }
.register-form .field-label { color: var(--paper); }
.register-form input,
.register-form textarea {
    width: 100%;
    font: inherit;
    font-size: 19px;
    padding: 14px 16px;
    border: 2.5px solid transparent;
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
}
.register-form textarea { resize: vertical; min-height: 120px; }
.register-form input:focus,
.register-form textarea:focus { outline: 4px solid var(--marigold); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.land-footer {
    text-align: center;
    color: var(--ink-soft);
    padding: 28px 16px 36px;
    font-size: 16px;
}

/* ---------- install banner ---------- */
.install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.install-banner .ios-share { font-size: 20px; }
.install-banner .install-go {
    font: inherit;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    background: var(--marigold);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    min-height: 48px;
    cursor: pointer;
    white-space: nowrap;
}
.install-banner .install-close {
    background: none;
    border: none;
    color: var(--paper);
    font-size: 20px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    margin-left: auto;
}

/* ---------- small screens ---------- */
@media (max-width: 380px) {
    .flat-grid { grid-template-columns: repeat(2, 1fr); }
    .collect-form { grid-template-columns: 1fr; }
    .hero-num { font-size: 64px; }
}
