/* TMS Tracking Light - Refined */

.tms-tracking-wrapper {
    max-width: 520px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
    direction: rtl;
    font-size: clamp(14px, 3.4vw, 15px);
    line-height: 1.55;
}

.tms-tracking-wrapper,
.tms-tracking-wrapper * {
    box-sizing: border-box;
}

.tms-form {
    display: flex !important;
    align-items: stretch;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    height: 3.35rem;
    padding: 0 !important;
    margin: 0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tms-form:focus-within {
    border-color: #e31e24;
    box-shadow: 0 12px 32px rgba(227, 30, 36, 0.14);
}

.tms-form input {
    flex-grow: 1;
    border: none !important;
    padding: 0 1.125rem !important;
    margin: 0 !important;
    outline: none !important;
    font-size: 1rem;
    text-align: center;
    background: transparent;
    min-width: 0;
    color: #0f172a;
    font-weight: 500;
}

.tms-form input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.tms-submit-btn {
    background: linear-gradient(135deg, #e31e24, #c41c1f) !important;
    border: none !important;
    width: 4.25rem;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.tms-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d51d22, #ad171b) !important;
}

.tms-submit-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.tms-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.tms-btn-icon {
    width: 22px;
    height: 22px;
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.tms-submit-btn.is-loading .tms-btn-icon {
    display: none;
}

.tms-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tms-spin 0.85s linear infinite;
}

.tms-submit-btn.is-loading .tms-loader {
    display: block;
}

@keyframes tms-spin {
    to {
        transform: rotate(360deg);
    }
}

.tms-result-container {
    margin-top: 1.25rem;
}

.tms-status-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.tms-step-val {
    color: #c41c1f;
    font-weight: 700;
}

.tms-divider {
    color: #cbd5e1;
}

.tms-actions {
    margin-top: 0.8rem;
}

.tms-details-link {
    display: inline-block;
    font-size: 0.82rem;
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.18s ease;
}

.tms-details-link:hover {
    color: #e31e24;
}

.tms-error {
    display: inline-block;
    margin-top: 0.75rem;
    color: #c41c1f;
    background: rgba(227, 30, 36, 0.08);
    border: 1px solid rgba(227, 30, 36, 0.15);
    padding: 0.7rem 1rem;
    border-radius: 0.875rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.fade-in {
    animation: tmsIn 0.35s ease-out;
}

@keyframes tmsIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 640px) {
    .tms-tracking-wrapper {
        padding: 0 1.25rem;
    }

    .tms-form {
        height: 3.5rem;
    }

    .tms-status-line {
        padding: 0.85rem 1.4rem;
    }
}

@media (max-width: 480px) {
    .tms-tracking-wrapper {
        margin: 1.5rem auto;
        padding: 0 0.875rem;
    }

    .tms-form input {
        font-size: 0.95rem;
        padding: 0 0.9rem !important;
    }

    .tms-submit-btn {
        width: 3.9rem;
    }

    .tms-status-line {
        border-radius: 1rem;
        padding: 0.85rem 1rem;
        line-height: 1.6;
    }

    .tms-divider {
        display: none;
    }
}