/**
 * Shipping Tracking — Redesigned Public Styles
 * Design: Dark-hero glassmorphism search + card grid results + vertical timeline
 */

/* ─────────────────────────────────────────
   CSS Custom Properties
───────────────────────────────────────── */
.st-wrap {
    --st-primary:       #6366f1;
    --st-primary-dark:  #4f46e5;
    --st-primary-glow:  rgba(99, 102, 241, 0.35);
    --st-success:       #10b981;
    --st-danger:        #ef4444;
    --st-warning:       #f97316;
    --st-text:          #1e293b;
    --st-text-muted:    #64748b;
    --st-text-faint:    #94a3b8;
    --st-border:        #e2e8f0;
    --st-surface:       #fff;
    --st-bg:            #f8fafc;
    --st-radius-sm:     8px;
    --st-radius-md:     12px;
    --st-radius-lg:     16px;
    --st-radius-xl:     20px;
    --st-shadow:        0 4px 24px rgba(0, 0, 0, 0.07);
    --st-shadow-lg:     0 8px 40px rgba(0, 0, 0, 0.12);

    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    box-sizing: border-box;
}

.st-wrap *, .st-wrap *::before, .st-wrap *::after {
    box-sizing: border-box;
}

/* ─────────────────────────────────────────
   Hero Section
───────────────────────────────────────── */
.st-hero {
    position: relative;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 55%, #24243e 100%);
    border-radius: var(--st-radius-xl);
    padding: 3.5rem 2rem 4rem;
    margin-bottom: 1.75rem;
    overflow: hidden;
    text-align: center;
}

/* Radial ambient glows */
.st-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 60%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Shimmer sweep */
.st-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 35%;
    height: 200%;
    background: linear-gradient(
        108deg,
        transparent 38%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 62%
    );
    animation: stShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes stShimmer {
    0%   { left: -60%; }
    100% { left: 130%; }
}

.st-hero-content {
    position: relative;
    z-index: 1;
    max-width: 580px;
    margin: 0 auto;
}

.st-hero-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.875rem;
    animation: stFloat 3.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.5));
}

@keyframes stFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

.st-hero-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(99, 102, 241, 0.4);
}

.st-hero-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin: 0 0 2rem;
}

/* ─────────────────────────────────────────
   Glassmorphism Search Card
───────────────────────────────────────── */
.st-glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--st-radius-lg);
    padding: 1.375rem 1.5rem;
}

.st-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.st-input-group {
    flex: 1;
    min-width: 180px;
    position: relative;
    display: flex;
    align-items: center;
}

.st-input-icon {
    position: absolute;
    left: 0.875rem;
    font-size: 1rem;
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
}

.st-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.6rem;
    background: rgba(255, 255, 255, 0.09);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--st-radius-sm);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.st-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.st-input:focus {
    border-color: rgba(99, 102, 241, 0.75);
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

/* ─────────────────────────────────────────
   Search Button
───────────────────────────────────────── */
.st-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: var(--st-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.st-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45);
}

.st-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.st-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.st-btn-arrow {
    transition: transform 0.2s ease;
    font-style: normal;
}

.st-btn:hover:not(:disabled) .st-btn-arrow {
    transform: translateX(4px);
}

/* Ripple */
.st-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    transform: scale(0);
    animation: stRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes stRipple {
    to { transform: scale(4); opacity: 0; }
}

/* ─────────────────────────────────────────
   reCAPTCHA
───────────────────────────────────────── */
.recaptcha-container {
    width: 100%;
    margin: 0.375rem 0;
    display: flex;
    justify-content: center;
}

.recaptcha-container:empty {
    display: none;
    margin: 0;
}

/* ─────────────────────────────────────────
   Loading
───────────────────────────────────────── */
.st-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.st-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.st-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--st-primary);
    display: block;
    animation: stBounce 1.3s ease-in-out infinite;
}

.st-dots span:nth-child(2) { animation-delay: 0.18s; }
.st-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes stBounce {
    0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
    40%            { transform: scale(1);    opacity: 1; }
}

.st-loading-text {
    color: var(--st-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ─────────────────────────────────────────
   Error Banner
───────────────────────────────────────── */
.st-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--st-danger);
    border-radius: var(--st-radius-md);
    padding: 0.875rem 1.125rem;
    color: #991b1b;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.st-error-box p { margin: 0; }

/* ─────────────────────────────────────────
   Results Reveal
───────────────────────────────────────── */
.st-results {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.st-results.st-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─────────────────────────────────────────
   Status Card
───────────────────────────────────────── */
.st-status-card {
    background: var(--st-surface);
    border-radius: var(--st-radius-lg);
    padding: 1.625rem 1.75rem;
    box-shadow: var(--st-shadow);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    border-left: 5px solid var(--status-color, var(--st-primary));
    transition: border-color 0.4s ease;
}

/* Soft ambient glow on the left accent */
.st-status-glow {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--status-color, var(--st-primary));
    filter: blur(10px);
    opacity: 0.45;
    pointer-events: none;
}

.st-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    background: var(--status-bg, #eef2ff);
    color: var(--status-color, var(--st-primary));
    animation: stBadgePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    flex-shrink: 0;
}

@keyframes stBadgePop {
    from { transform: scale(0.55); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.st-status-icon { font-size: 1.2rem; }

.st-tracking-id {
    flex: 1;
    min-width: 0;
}

.st-tid-label {
    display: block;
    font-size: 0.7rem;
    color: var(--st-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.st-tid-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--st-text);
    letter-spacing: 0.05em;
    font-family: "Courier New", "Consolas", monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─────────────────────────────────────────
   Body Grid
───────────────────────────────────────── */
.st-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ─────────────────────────────────────────
   Section Cards (shared)
───────────────────────────────────────── */
.st-info-section,
.st-timeline-section {
    background: var(--st-surface);
    border-radius: var(--st-radius-lg);
    padding: 1.625rem;
    box-shadow: var(--st-shadow);
}

.st-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--st-text);
    margin: 0 0 1.125rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--st-bg);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────
   Info Chips
───────────────────────────────────────── */
.st-chips-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.st-chip {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--st-bg);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-md);
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity 0.38s ease, transform 0.38s ease, box-shadow 0.2s, border-color 0.2s;
}

.st-chip.st-chip-visible {
    opacity: 1;
    transform: translateX(0);
}

.st-chip:hover {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
    border-color: #c7d2fe;
}

.st-chip-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.st-chip-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.st-chip-label {
    font-size: 0.68rem;
    color: var(--st-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.st-chip-value {
    font-size: 0.93rem;
    color: var(--st-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─────────────────────────────────────────
   Exception Card
───────────────────────────────────────── */
.st-exception-card {
    margin-top: 1rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--st-warning);
    border-radius: var(--st-radius-sm);
    padding: 0.875rem 1rem;
    color: #7c2d12;
    font-size: 0.875rem;
    animation: stFadeIn 0.35s ease;
}

.st-exception-card p {
    margin: 0.25rem 0 0;
    line-height: 1.5;
}

.st-exception-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.st-redelivery {
    margin-top: 0.75rem;
    padding: 0.6rem 0.875rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--st-radius-sm);
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.st-redelivery-badge {
    background: #16a34a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────
   Vertical Timeline
───────────────────────────────────────── */
.st-timeline {
    position: relative;
    padding-left: 2.25rem;
}

/* Static grey track */
.st-timeline::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: var(--st-border);
    border-radius: 2px;
}

/* Animated progress fill */
.st-timeline-fill {
    position: absolute;
    left: 17px;
    top: 18px;
    width: 2px;
    background: linear-gradient(to bottom, var(--st-primary), var(--st-success));
    height: 0;
    border-radius: 2px;
    transition: height 1.1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Timeline Item */
.st-timeline-item {
    position: relative;
    padding: 0 0 1.625rem 1.375rem;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.st-timeline-item:last-child {
    padding-bottom: 0;
}

.st-timeline-item.st-item-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Node circle */
.st-timeline-dot {
    position: absolute;
    left: -2.25rem;
    top: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2.5px solid var(--st-border);
    background: var(--st-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    z-index: 2;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* State modifiers */
.st-timeline-item.st-step-completed .st-timeline-dot {
    background: var(--st-success);
    border-color: var(--st-success);
}

.st-timeline-item.st-step-active .st-timeline-dot {
    background: var(--st-primary);
    border-color: var(--st-primary);
    animation: stNodePulse 2.2s ease-in-out infinite;
}

.st-timeline-item.st-step-error .st-timeline-dot {
    background: var(--st-danger);
    border-color: var(--st-danger);
}

.st-timeline-item.st-step-pending .st-timeline-dot {
    background: #f8fafc;
    border-color: #cbd5e1;
}

@keyframes stNodePulse {
    0%   { box-shadow: 0 0 0 0   rgba(99, 102, 241, 0.6); }
    70%  { box-shadow: 0 0 0 11px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0   rgba(99, 102, 241, 0); }
}

/* Content */
.st-timeline-content {
    padding-top: 0.05rem;
}

.st-timeline-title {
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--st-text);
    margin-bottom: 0.15rem;
    line-height: 1.4;
}

.st-timeline-item.st-step-pending .st-timeline-title {
    color: var(--st-text-faint);
    font-weight: 500;
}

.st-timeline-date {
    font-size: 0.78rem;
    color: var(--st-text-faint);
}

.st-timeline-item.st-step-completed .st-timeline-date,
.st-timeline-item.st-step-active .st-timeline-date {
    color: var(--st-text-muted);
}

.st-timeline-error-note {
    margin-top: 0.4rem;
    padding: 0.35rem 0.65rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    font-size: 0.775rem;
    color: #9a3412;
    line-height: 1.45;
}

/* ─────────────────────────────────────────
   Utility
───────────────────────────────────────── */
@keyframes stFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   Responsive — tablet
───────────────────────────────────────── */
@media (max-width: 768px) {
    .st-hero {
        padding: 2.5rem 1.25rem 3rem;
        border-radius: var(--st-radius-lg);
    }

    .st-hero-title {
        font-size: 1.6rem;
    }

    .st-form {
        flex-direction: column;
        align-items: stretch;
    }

    .st-btn {
        justify-content: center;
    }

    .st-status-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.875rem;
    }

    .st-body-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────
   Responsive — mobile
───────────────────────────────────────── */
@media (max-width: 480px) {
    .st-wrap {
        padding: 0.5rem;
    }

    .st-hero {
        padding: 2rem 1rem 2.5rem;
        border-radius: var(--st-radius-md);
    }

    .st-hero-icon { font-size: 2.25rem; }
    .st-hero-title { font-size: 1.35rem; }
    .st-hero-subtitle { font-size: 0.875rem; }

    .st-tid-value { font-size: 0.95rem; }

    .st-status-card {
        padding: 1.25rem;
    }

    .st-info-section,
    .st-timeline-section {
        padding: 1.25rem;
    }
}
