/* ============================================
   GLS Italy Tracking - Public Page Styles
   ============================================ */

:root {
    --primary: #003087;
    --primary-light: #0056b3;
    --success: #28a745;
    --success-light: #d4edda;
    --warning: #f0ad4e;
    --warning-light: #fff3cd;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --info: #17a2b8;
    --info-light: #d1ecf1;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --white: #ffffff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #003087 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--gray-800);
}

/* ---- Tracking Card ---- */
.tracking-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Header ---- */
.tracking-header {
    background: var(--primary);
    color: var(--white);
    padding: 28px 30px;
    text-align: center;
}

.tracking-header .logo {
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 6px;
}

.tracking-header h1 {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
}

.tracking-number-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 12px;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

/* ---- Status Badge ---- */
.status-section {
    padding: 20px 30px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.3px;
}

.status-badge.consegnato {
    background: var(--success-light);
    color: #155724;
}

.status-badge.spedito,
.status-badge.in-transito {
    background: var(--info-light);
    color: #0c5460;
}

.status-badge.in-elaborazione {
    background: var(--warning-light);
    color: #856404;
}

.status-badge.annullato {
    background: var(--danger-light);
    color: #721c24;
}

.status-badge .icon {
    font-size: 1.2em;
}

/* ---- Timeline ---- */
.timeline {
    padding: 24px 30px;
    border-bottom: 1px solid var(--gray-200);
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 30px;
    right: 30px;
    height: 3px;
    background: var(--gray-200);
    z-index: 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.timeline-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--gray-500);
    transition: all 0.3s ease;
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--gray-200);
}

.timeline-step.active .timeline-dot {
    background: var(--success);
    color: var(--white);
    box-shadow: 0 0 0 2px var(--success);
}

.timeline-step.current .timeline-dot {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 2px var(--primary), 0 0 12px rgba(0, 48, 135, 0.3);
}

.timeline-step.cancelled .timeline-dot {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 0 0 2px var(--danger);
}

.timeline-label {
    font-size: 0.65em;
    color: var(--gray-600);
    margin-top: 8px;
    text-align: center;
    max-width: 70px;
    line-height: 1.3;
}

.timeline-step.active .timeline-label,
.timeline-step.current .timeline-label {
    color: var(--gray-800);
    font-weight: 600;
}

/* ---- Details ---- */
.tracking-details {
    padding: 24px 30px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.85em;
    color: var(--gray-600);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--gray-800);
    text-align: right;
}

/* ---- Contact Footer ---- */
.tracking-footer {
    background: var(--gray-50);
    padding: 20px 30px;
    border-top: 1px solid var(--gray-200);
}

.contact-title {
    font-size: 0.8em;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 12px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.85em;
    color: var(--gray-700);
}

.contact-row .icon {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.contact-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-row a:hover {
    text-decoration: underline;
}

.footer-brand {
    text-align: center;
    padding-top: 16px;
    margin-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8em;
    color: var(--gray-500);
}

.footer-brand a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ---- Error State ---- */
.tracking-error {
    padding: 40px 30px;
    text-align: center;
}

.tracking-error .error-icon {
    font-size: 3em;
    margin-bottom: 16px;
}

.tracking-error h2 {
    font-size: 1.2em;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.tracking-error p {
    color: var(--gray-600);
    font-size: 0.9em;
}

/* ---- Search Form (on error page) ---- */
.search-form {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.search-form input:focus {
    border-color: var(--primary);
}

.search-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--primary-light);
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .tracking-card {
        border-radius: var(--radius-sm);
    }

    .tracking-header {
        padding: 22px 20px;
    }

    .tracking-header h1 {
        font-size: 1.2em;
    }

    .timeline {
        padding: 20px 15px;
    }

    .timeline-label {
        font-size: 0.6em;
        max-width: 55px;
    }

    .timeline-dot {
        width: 28px;
        height: 28px;
        font-size: 0.65em;
    }

    .tracking-details,
    .tracking-footer,
    .status-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .detail-value {
        text-align: left;
    }
}
