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

:root {
    --blue: #3498db;
    --blue-dark: #2980b9;
    --green: #07bc0c;
    --red: #e74c3c;
    --yellow: #f1c40f;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #121212;
    --text-light: #616161;
    --border: #e0e0e0;
    --radius: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

header .logo {
    height: 36px;
    width: auto;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

main {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 16px;
}

footer {
    text-align: center;
    padding: 16px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

/* Search card */
.search-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.search-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row input {
    flex: 1;
    padding: 10px 14px;
    font-size: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.input-row input:focus {
    border-color: var(--blue);
}

.input-row button {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.input-row button:hover { background: var(--blue-dark); }
.input-row button:disabled { opacity: 0.6; cursor: not-allowed; }

.hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
}

/* Error */
.error-msg {
    background: #fdecea;
    color: var(--red);
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

/* Loading */
.loading {
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-light);
}

.loading:not([hidden]) {
    display: flex;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.result-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.result-card .card-header {
    padding: 16px 20px;
    background: var(--blue);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header .shipment-id {
    font-size: 20px;
    font-weight: 700;
}

.card-header .shipment-type {
    font-size: 13px;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 12px;
}

.card-body { padding: 20px; }

/* Status progress */
.status-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}

.status-bar::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 0;
}

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

.status-bar .dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--border);
    margin-bottom: 6px;
    transition: all 0.3s;
}

.status-bar .step.active .dot {
    background: var(--blue);
    box-shadow: 0 0 0 2px var(--blue);
}

.status-bar .step.completed .dot {
    background: var(--green);
    box-shadow: 0 0 0 2px var(--green);
}

.status-bar .step-label {
    font-size: 10px;
    color: var(--text-light);
    text-align: center;
    max-width: 70px;
}

.status-bar .step.active .step-label,
.status-bar .step.completed .step-label {
    color: var(--text);
    font-weight: 600;
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.info-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 3px;
    font-weight: 600;
}

.info-item .value {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

/* Alerts */
.alerts-section { margin-top: 16px; }

.alerts-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.alert-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px 4px 2px 0;
    background: #fff3cd;
    color: #856404;
}

.alert-badge.resolved {
    background: #d4edda;
    color: #155724;
}

/* Carrier link */
.carrier-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.carrier-link:hover { background: var(--blue-dark); }

/* Responsive */
@media (max-width: 520px) {
    .info-grid { grid-template-columns: 1fr; }
    .status-bar .step-label { font-size: 9px; max-width: 55px; }
    .status-bar .dot { width: 22px; height: 22px; }
    .card-header .shipment-id { font-size: 17px; }
}
