/* Track Your Application — bilingual minimal UI
   ============================================== */

.ta-frame-wrap,
.ta-frame-wrap *,
.ta-frame,
.ta-frame * {
    box-sizing: border-box;
}

/* Wrapper that holds the top "Back to Home" pill and the frame together */
.ta-frame-wrap {
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.ta-frame-topbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 4px;
}

.ta-frame-topbar .ta-tag-home {
    margin-bottom: 0;
}

.ta-frame {
    position: relative;
    overflow: hidden;
    padding: 60px 24px;
    background: #fafaf7;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    border-radius: 28px;
}

/* Decorative background */
.ta-bg-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 90%);
            mask-image: radial-gradient(ellipse at center, #000 40%, transparent 90%);
}

.ta-bg-blob {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}
.ta-bg-blob-a { background: #f4d35e; opacity: 0.22; top: -120px; right: -120px; }
.ta-bg-blob-b { background: #e8b478; opacity: 0.16; bottom: -160px; left: -120px; }

.ta-container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

/* Header row (live status + home pill) */
.ta-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

/* Tag pill */
.ta-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.ta-header-row .ta-tag { margin-bottom: 0; }

.ta-tag-home {
    padding: 6px 14px;
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ta-tag-home svg { flex-shrink: 0; color: #888; transition: color 0.2s ease; }
.ta-tag-home:hover {
    color: #c89c4f;
    border-color: rgba(200, 156, 79, 0.45);
    box-shadow: 0 6px 18px rgba(200, 156, 79, 0.18);
}
.ta-tag-home:hover svg { color: #c89c4f; }
.ta-tag-home:focus-visible { outline: 2px solid #c89c4f; outline-offset: 2px; }
.ta-tag-pin {
    width: 10px;
    height: 10px;
    margin: 0 4px 0 6px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ta-tag-pin-pulse 1.8s ease-in-out infinite;
}
@keyframes ta-tag-pin-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
.ta-tag [dir="rtl"] { font-family: 'Tajawal', sans-serif; }

/* Titles */
.ta-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 300;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: #0f0f0f;
    margin: 0 0 10px;
}
.ta-title em {
    font-style: italic;
    font-weight: 400;
    color: #c89c4f;
}

.ta-title-ar {
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.2;
    color: #0f0f0f;
    margin: 0 0 24px;
    direction: rtl;
}
.ta-title-ar em {
    font-style: normal;
    font-weight: 700;
    color: #c89c4f;
}

.ta-sub {
    font-weight: 300;
    font-size: 17px;
    line-height: 1.55;
    color: #666;
    max-width: 440px;
    margin: 0 0 4px;
}
.ta-sub-ar {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    color: #666;
    max-width: 440px;
    margin: 0 0 40px;
}

/* Search card */
.ta-card {
    background: #fff;
    border-radius: 24px;
    padding: 26px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 30px 60px -20px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

.ta-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #888;
}
.ta-card-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}
.ta-card-label [dir="rtl"] {
    font-family: 'Tajawal', sans-serif;
    letter-spacing: 0;
}

.ta-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f4f3ee;
    padding: 4px 4px 4px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.ta-input-row:focus-within {
    background: #fff;
    border-color: #c89c4f;
    box-shadow: 0 0 0 4px rgba(200, 156, 79, 0.1);
}

.ta-input-icon { flex-shrink: 0; color: #999; }

.ta-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0 !important;
    outline: 0;
    padding: 18px 0;
    font-family: inherit;
    font-size: 16px;
    color: #1a1a1a;
    box-shadow: none;
}
.ta-input:focus { box-shadow: none; }
.ta-input::placeholder { color: #999; font-weight: 300; }

.ta-input-go {
    align-self: stretch;
    width: 48px;
    flex-shrink: 0;
    border: 0;
    border-radius: 12px;
    background: #c89c4f;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 6px 16px rgba(200, 156, 79, 0.28);
    padding: 0;
}
.ta-input-go svg {
    display: block;
    transform: translateX(-1px);
}
.ta-input-go:hover {
    background: #b6883c;
    transform: scale(1.04);
    box-shadow: 0 10px 22px rgba(200, 156, 79, 0.38);
}
.ta-input-go:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }

/* Foot info */
.ta-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 14px 18px;
    background: rgba(200, 156, 79, 0.08);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #7a5a2a;
}
.ta-foot svg { flex-shrink: 0; }

/* Error message */
.ta-error {
    max-width: 640px;
    margin: 16px auto 0;
    padding: 14px 18px;
    background: #fdecea;
    border: 1px solid #f5b7b1;
    border-radius: 12px;
    color: #922b21;
    font-size: 14px;
    text-align: center;
}

/* =======================================================
   RESULT VIEW
   ======================================================= */
.ta-greeting {
    margin: 0 0 22px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 300;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.2;
    color: #0f0f0f;
    text-align: center;
}
.ta-greeting-hi { color: #888; margin-right: 8px; }
.ta-greeting-name {
    color: #c89c4f;
    font-style: italic;
    font-weight: 400;
}

.ta-meta-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 18px;
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 18px 40px -20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}
.ta-meta-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.ta-meta-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}
.ta-meta-value {
    font-size: 14px;
    font-weight: 500;
    color: #c89c4f;
    word-break: break-word;
}

/* Progress track */
.ta-track {
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px 24px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 30px 60px -20px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

.ta-stages {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.ta-stages-line {
    position: absolute;
    top: 14px;
    left: 12.5%;
    right: 12.5%;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #c89c4f;
    z-index: 0;
}

.ta-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 6px;
}

.ta-stage-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #c89c4f;
    color: #fff;
    box-shadow: 0 0 0 4px #fff;
    flex-shrink: 0;
}
.ta-stage-pending .ta-stage-dot {
    background: #ecdfc8;
    color: #c89c4f;
}
.ta-stage-active .ta-stage-dot,
.ta-stage-live .ta-stage-dot {
    animation: ta-pulse 1.8s ease-in-out infinite;
}
.ta-stage-rejected .ta-stage-dot {
    background: #dc2626;
    color: #fff;
}
.ta-stage-rejected .ta-stage-name {
    color: #dc2626;
}
@keyframes ta-pulse {
    0%, 100% { box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(200, 156, 79, 0.5); }
    50%      { box-shadow: 0 0 0 4px #fff, 0 0 0 12px rgba(200, 156, 79, 0); }
}

.ta-stage-info {
    margin-top: 14px;
    text-align: center;
}
.ta-stage-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.ta-stage-date,
.ta-stage-time {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}
.ta-stage-pending .ta-stage-name { color: #888; }

/* Actions */
.ta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}
.ta-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    line-height: 1;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}
.ta-cta svg { flex-shrink: 0; }
.ta-cta:hover {
    background: #c89c4f;
    color: #fff;
    border-color: #c89c4f;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(200, 156, 79, 0.36);
}
.ta-cta:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 3px; }

.ta-cta-ghost {
    background: #fff;
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.ta-cta-ghost:hover {
    background: #fff;
    color: #c89c4f;
    border-color: #c89c4f;
    box-shadow: 0 10px 22px rgba(200, 156, 79, 0.18);
}

@media (max-width: 480px) {
    .ta-actions { flex-direction: column; align-items: stretch; }
    .ta-cta { justify-content: center; }
}

/* =======================================================
   MOBILE
   ======================================================= */
@media (max-width: 640px) {
    .ta-frame { padding: 40px 16px; border-radius: 20px; }
    .ta-card,
    .ta-track { padding: 22px 18px; }

    .ta-meta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .ta-meta-item { width: 100%; justify-content: space-between; }

    /* Vertical timeline */
    .ta-stages {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-left: 4px;
    }
    .ta-stages-line {
        top: 22px;
        bottom: 22px;
        left: 15px;
        right: auto;
        width: 6px;
        height: auto;
        transform: none;
    }
    .ta-stage {
        flex-direction: row;
        align-items: flex-start;
        gap: 18px;
        padding: 8px 0;
    }
    .ta-stage-dot {
        width: 26px;
        height: 26px;
        margin-top: 4px;
    }
    .ta-stage-info {
        margin-top: 0;
        text-align: left;
        flex: 1;
        padding-top: 2px;
    }
    .ta-stage-name { font-size: 14px; }
    .ta-stage-date,
    .ta-stage-time { font-size: 12px; }

    .ta-greeting { font-size: 22px; }
}

@media (max-width: 640px) {
    .ta-input { font-size: 16px; }
    .ta-input::placeholder { font-size: 13px; }
}

@media (max-width: 380px) {
    .ta-input-go { width: 42px; height: 42px; }
}
