/* ============================================================
   An Post kit — stylesheet (CTT-style structure)
   Palette from the real anpost.ie CSS: #00a76a / #008755 / #94eb5a
   Covers the SPA (index.html) and the standalone pages/.
   ============================================================ */

:root {
    --green:      #00a76a;
    --green-dark: #008755;
    --green-deep: #006150;
    --lime:       #94eb5a;
    --accent:     #94eb5a;
    --ink:        #1c2e2a;
    --muted:      #5f6d68;
    --line:       #dde9e3;
    --bg-soft:    #f7faf9;
    --amber-bg:   #fff4d6;
    --amber-ink:  #9a6b00;
    --red:        #c0392b;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: #fff;
    line-height: 1.5;
}

img { max-width: 100%; }

::selection { background: rgba(148, 235, 90, .55); }

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green-deep); }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

main.container { padding-bottom: 3rem; }

/* ============================================================
   Header — deep green bar + white nav strip (matches anpost.com)
   ============================================================ */

.header { background: var(--green-dark); }

.header__utility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .5rem;
    padding-bottom: .5rem;
    font-size: .8rem;
}

.header__utility nav a,
.header__auth a { color: rgba(255, 255, 255, .78); }

.header__utility nav a:hover,
.header__auth a:hover { color: #fff; }

.header__utility nav a.current {
    color: #fff;
    font-weight: 700;
    border-bottom: 2px solid var(--lime);
    padding-bottom: .1rem;
}

.header__auth a + a { margin-left: 1rem; }

.header__search { display: inline-flex; align-items: center; color: #fff !important; opacity: .85; }
.header__search:hover { opacity: 1; }
.header__search svg { width: 14px; height: 14px; }

/* logo row */

.header__logo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: .85rem;
    padding-bottom: 1rem;
}

.header__logo img { height: 42px; width: auto; }

.header__find-office {
    color: #fff;
    font-size: .8rem;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    padding: .35rem .95rem;
    transition: background-color .15s ease;
}

.header__find-office:hover { background: rgba(255, 255, 255, .14); }

/* white nav strip */

.header__navbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.header__navbar ul {
    display: flex;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header__navbar a {
    font-weight: 600;
    color: #1b1e1c;
    padding: .85rem 0 .55rem;
    border-bottom: 3px solid transparent;
}

.header__navbar a.active,
.header__navbar a:hover {
    color: var(--green-dark);
    border-bottom-color: var(--lime);
}

/* ============================================================
   Breadcrumb + titles
   ============================================================ */

.breadcrumb {
    font-size: .8rem;
    color: var(--muted);
    margin: 1.25rem 0 1rem;
}

.breadcrumb a { color: var(--green-dark); }
.breadcrumb span { margin: 0 .3rem; color: #b9c7c1; }

.page-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 1.25rem; }
.page-title--center { text-align: center; }

/* ============================================================
   Track hero (step 1)
   ============================================================ */

.track-hero {
    background: linear-gradient(180deg, #f4faf7 0%, var(--bg-soft) 100%);
    border-radius: 16px;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
}

.track-hero__title { font-size: 2.1rem; font-weight: 800; margin: 0 0 .25rem; letter-spacing: -.01em; }

.track-search {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    background: #fff;
    padding: .9rem 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 60, 40, .08);
    max-width: 640px;
    margin: 1.25rem auto .75rem;
}

.track-search label {
    flex-basis: 100%;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 600;
    padding-left: .25rem;
}

.track-search input {
    flex: 1 1 420px;
    border: 1px solid #cfe0d9;
    border-radius: 8px;
    padding: .7rem .8rem;
    font-size: 1.05rem;
    color: var(--ink);
}

.track-hero__hint { font-size: .85rem; color: var(--muted); margin-bottom: 0; }

/* ============================================================
   Alert strip + cards
   ============================================================ */

.alert-strip {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fff8e6;
    border: 1px solid #f3e2b3;
    border-radius: 10px;
    padding: .9rem 1.1rem;
    margin: 1.25rem 0;
}

.alert-strip img { width: 28px; flex-shrink: 0; }
.alert-strip p { margin: 0; font-size: .95rem; }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 60, 40, .04);
}

.parcel-card { scroll-margin-top: 1rem; }

.parcel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.last-updated { color: var(--muted); font-size: .85rem; margin: .2rem 0 0; }

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: .3rem .8rem;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge--amber { background: var(--amber-bg); color: var(--amber-ink); }

.parcel-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: .9rem 0 1.1rem;
    border-bottom: 1px solid var(--line);
}

.meta-label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: .15rem;
}

.meta-value { font-weight: 600; }

/* timeline */

.timeline { list-style: none; margin: 1.25rem 0 0; padding: 0; }

.timeline li {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem 0;
}

.t-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e3f7ec;
    color: var(--green-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.timeline li.failed .t-icon { background: #fdecea; color: var(--red); }

.t-body { flex: 1; min-width: 0; }

.t-title { display: block; font-weight: 600; }

.t-sub { display: block; font-size: .8rem; color: var(--muted); }

.t-date { font-size: .85rem; color: var(--muted); white-space: nowrap; }

.parcel-note {
    background: #f4faf7;
    border-left: 3px solid var(--green);
    border-radius: 0 6px 6px 0;
    padding: .7rem .9rem;
    font-size: .85rem;
    color: var(--muted);
}

/* ============================================================
   Forms
   ============================================================ */

.form-intro { color: var(--muted); font-size: .9rem; }

#form-details,
#form-payment { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }

.field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .35rem;
}

.req { color: var(--red); }

.hint { font-weight: 400; color: var(--muted); font-size: .78rem; }

.field input,
.field select {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #cfe0d9;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--ink);
    background: #fff;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 167, 106, .15);
}

.field--full { grid-column: 1 / -1; }

/* honeypot — off-screen but present for bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card-row { display: contents; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .8rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.btn:hover { background: var(--green-dark); }

.btn:active { transform: translateY(1px); }

.btn--small { padding: .6rem 1.2rem; font-size: .9rem; }

.btn--full { width: 100%; }

/* ============================================================
   Payment step
   ============================================================ */

.pay-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.pay-amount { font-size: 2rem; font-weight: 800; color: var(--green-deep); white-space: nowrap; }

.field--brands { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; }

.brand-icons img { height: 26px; width: auto; opacity: .45; transition: opacity .15s ease; }
.brand-icons img.is-active { opacity: 1; }

.secure-note {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--muted);
    margin: 0;
}

.secure-note img { width: 20px; flex-shrink: 0; }

.secure-note--center { justify-content: center; text-align: center; }

/* ============================================================
   OTP (kept as before)
   ============================================================ */

.card--otp { max-width: 540px; margin-left: auto; margin-right: auto; }

.otp-intro { font-size: .95rem; }

.otp-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-bottom: .9rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
}

.otp-resend { text-align: center; font-size: .85rem; margin-top: .75rem; }

.otp-row { display: flex; gap: .5rem; justify-content: center; margin: 1.25rem 0; }

.otp-box {
    width: 54px;
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid #cfe0d9;
    border-radius: 10px;
    color: var(--ink);
}

.otp-box:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 167, 106, .15);
}

.error-msg { color: var(--red); font-size: .85rem; display: none; }

/* ============================================================
   Success screen
   ============================================================ */

.done-wrap { text-align: center; max-width: 480px; margin: 2.5rem auto; }

.done-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.done-text { color: var(--muted); }

.progress-track { height: 8px; background: #e3ece8; border-radius: 999px; overflow: hidden; margin: 1.5rem 0 .75rem; }

.progress-fill { width: 0; height: 100%; background: var(--green); animation: fillbar 2.4s ease forwards; }

@keyframes fillbar { to { width: 100%; } }

.done-redirect { font-size: .85rem; color: var(--muted); }

/* ============================================================
   Footer + cookie banner
   ============================================================ */

.footer { background: var(--green-dark); color: #fff; padding: 2.5rem 0 1.5rem; }

.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }

.cols h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #fff; margin: 0 0 .6rem; }

.cols ul { list-style: none; margin: 0; padding: 0; }
.cols li + li { margin-top: .4rem; }
.cols a { font-size: .85rem; color: rgba(255, 255, 255, .78); }
.cols a:hover { color: #fff; text-decoration: underline; }
.cols a.active { color: #fff; font-weight: 600; }

.footer__contact p { font-size: .85rem; color: rgba(255, 255, 255, .78); margin: 0 0 .4rem; }
.footer__contact .phone { font-weight: 700; color: #fff; }
.footer__contact .hours { font-size: .78rem; }

.footer__social { display: flex; gap: .6rem; margin-bottom: 1.5rem; }
.footer__social a {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255, 255, 255, .14); color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    display: flex; align-items: center; justify-content: center;
    transition: background-color .15s ease, color .15s ease;
}
.footer__social a:hover { background: #fff; color: var(--green-dark); }
.footer__social svg { width: 17px; height: 17px; }

.footer__bottom {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .28); padding-top: 1.25rem;
}
.legal-links { display: flex; flex-wrap: wrap; gap: .9rem; }
.legal-links a { font-size: .78rem; color: rgba(255, 255, 255, .7); }
.legal { text-align: right; font-size: .78rem; color: rgba(255, 255, 255, .6); margin: 0; }

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 60, 40, .12);
    padding: .9rem 1.5rem;
}

.cookie-banner p { margin: 0; font-size: .85rem; max-width: 640px; }

/* ============================================================
   Step panels (SPA)
   ============================================================ */

.step-panel { display: none; }
.step-panel.active { display: block; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 720px) {
    .container { padding-left: 1rem; padding-right: 1rem; }

    .track-hero { padding: 1.75rem 1rem 1.5rem; }
    .track-hero__title { font-size: 1.6rem; }

    .parcel-meta { grid-template-columns: repeat(2, 1fr); }

    #form-details,
    #form-payment { grid-template-columns: 1fr; }

    .pay-summary { flex-direction: column; align-items: flex-start; }

    .cols { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }

    .footer__bottom { flex-direction: column; align-items: flex-start; }
    .legal { text-align: left; }

    .otp-box { width: 46px; height: 52px; font-size: 1.25rem; }
}

@media (max-width: 560px) {
    .cols { grid-template-columns: 1fr; gap: 1.1rem; }

    .otp-summary { grid-template-columns: 1fr; gap: .4rem; padding-bottom: .75rem; margin-bottom: 1rem; }
}

@media (max-width: 640px) {
    .header__utility,
    .header__navbar,
    .header__find-office { display: none; }

    .header__logo-row { justify-content: center; padding-top: .75rem; padding-bottom: .9rem; }
}
