/* stile.css - Posta 3000 Tracking - versione 2026 */

:root {
    --brand: #8c0000;
    --brand-dark: #650000;
    --brand-soft: #fff2f2;
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #677384;
    --line: #e2e8f0;
    --success: #0f7b44;
    --info: #1769aa;
    --warning: #b45f06;
    --danger: #b42318;
    --neutral: #64748b;
    --shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
    --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.08);
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --max-width: 980px;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(140, 0, 0, 0.16), transparent 34rem),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #eef1f5 100%);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    padding: 28px 18px 76px;
}

.site-header-inner {
    width: min(100%, var(--max-width));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-mark {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 0 0 4px;
    color: inherit;
    opacity: 0.78;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.site-header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.header-subtitle {
    max-width: 660px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.86);
}

.page-wrap {
    width: min(calc(100% - 28px), var(--max-width));
    margin: -48px auto 28px;
}

.search-card,
.result-card,
.notice-card,
.agency-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: clamp(20px, 4vw, 34px);
    backdrop-filter: blur(10px);
}

.search-card h2,
.result-card h2,
.notice-card h2,
.agency-card h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.card-intro,
.field-help,
.notice-card p,
.agency-card p,
.site-footer p {
    color: var(--muted);
}

.card-intro {
    margin: 10px 0 22px;
}

.field-label {
    display: block;
    margin: 0 0 8px;
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
}

.textfield {
    width: 100%;
    min-height: 54px;
    padding: 14px 16px;
    color: var(--text);
    background: #ffffff;
    border: 2px solid #d7dde7;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.textfield:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(140, 0, 0, 0.12);
}

.button {
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.button:active {
    transform: translateY(1px);
}

.button-primary {
    color: #ffffff;
    background: var(--brand);
    box-shadow: 0 10px 20px rgba(140, 0, 0, 0.22);
}

.button-primary:hover {
    background: var(--brand-dark);
}

.button-secondary {
    color: var(--text);
    background: #eef2f7;
}

.field-help {
    margin: 10px 0 0;
    font-size: 0.92rem;
}

.notice-card,
.result-card,
.agency-card {
    margin-top: 18px;
}

.notice-card {
    border-left: 6px solid var(--brand);
}

.notice-card--info {
    border-left-color: var(--info);
}

.notice-card--warning {
    border-left-color: var(--warning);
}

.notice-card--error {
    border-left-color: var(--danger);
}

.notice-card p {
    margin: 10px 0 0;
    font-weight: 600;
}

.result-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.result-card .eyebrow,
.agency-card .eyebrow {
    color: var(--brand);
    opacity: 1;
}

.result-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 4px 12px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.status-summary {
    display: grid;
    gap: 5px;
    margin: 22px 0 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--neutral);
    border-radius: var(--radius-lg);
    background: #f8fafc;
}

.status-summary--success {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.status-summary--info {
    border-left-color: var(--info);
    background: #eff8ff;
}

.status-summary--warning {
    border-left-color: var(--warning);
    background: #fff8eb;
}

.status-summary--danger {
    border-left-color: var(--danger);
    background: #fff1f0;
}

.status-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.status-summary strong {
    font-size: clamp(1.18rem, 3vw, 1.5rem);
}

.status-summary time {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.timeline {
    position: relative;
    margin-top: 22px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 12px;
    width: 2px;
    background: var(--line);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 14px;
    padding: 0 0 18px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    margin-top: 2px;
    border: 5px solid #ffffff;
    border-radius: 50%;
    background: var(--neutral);
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.22), var(--shadow-soft);
}

.timeline-item--success .timeline-dot {
    background: var(--success);
    box-shadow: 0 0 0 1px rgba(15, 123, 68, 0.22), var(--shadow-soft);
}

.timeline-item--info .timeline-dot {
    background: var(--info);
    box-shadow: 0 0 0 1px rgba(23, 105, 170, 0.22), var(--shadow-soft);
}

.timeline-item--warning .timeline-dot {
    background: var(--warning);
    box-shadow: 0 0 0 1px rgba(180, 95, 6, 0.22), var(--shadow-soft);
}

.timeline-item--danger .timeline-dot {
    background: var(--danger);
    box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.22), var(--shadow-soft);
}

.timeline-content {
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.timeline-content time {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.timeline-content p {
    margin: 0;
    font-weight: 700;
}

.timeline-item--current .timeline-content {
    border-color: rgba(140, 0, 0, 0.35);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.current-badge {
    display: inline-flex;
    margin-left: 7px;
    padding: 2px 8px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.5;
    text-transform: uppercase;
    vertical-align: middle;
}

.inline-link {
    font-weight: 800;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.result-actions .button {
    min-height: 46px;
}

.text-link {
    font-weight: 800;
}

.agency-card {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    color: #ffffff;
}

.agency-card .eyebrow,
.agency-card p,
.agency-card a {
    color: rgba(255, 255, 255, 0.88);
}

.agency-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.agency-card h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.agency-card address {
    font-style: normal;
    color: rgba(255, 255, 255, 0.9);
}

.site-footer {
    width: min(calc(100% - 28px), var(--max-width));
    margin: 0 auto 28px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.92rem;
}

.privacy-note {
    margin-top: 8px !important;
    font-size: 0.82rem !important;
}

.privacy-note a {
    font-weight: 700;
}

:focus-visible {
    outline: 3px solid rgba(140, 0, 0, 0.35);
    outline-offset: 3px;
}

@media (max-width: 720px) {
    .site-header {
        padding-bottom: 66px;
    }

    .site-header-inner {
        align-items: flex-start;
    }

    .brand-mark {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 18px;
        font-size: 0.86rem;
    }

    .search-row,
    .agency-grid {
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .result-heading {
        flex-direction: column;
    }

    .result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .result-actions .text-link {
        padding: 8px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
