.trw-smart-loader {
    align-items: center;
    display: grid;
    inset: 0;
    justify-items: center;
    opacity: 0;
    overflow: auto;
    padding: 24px;
    pointer-events: none;
    position: fixed;
    transition: opacity .2s ease;
    z-index: 2147483000;
}

.trw-smart-loader[hidden] {
    display: none !important;
}

.trw-smart-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.trw-smart-loader-backdrop {
    background:
        linear-gradient(135deg, rgba(3, 18, 14, .96), rgba(5, 34, 24, .94)),
        radial-gradient(circle at 20% 20%, rgba(226, 31, 38, .16), transparent 42%),
        radial-gradient(circle at 82% 78%, rgba(247, 196, 31, .15), transparent 40%);
    backdrop-filter: blur(9px);
    inset: 0;
    position: absolute;
}

.trw-smart-loader-panel {
    background: linear-gradient(155deg, rgba(255, 255, 255, .99), rgba(242, 248, 244, .98));
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .36);
    color: #163226;
    max-width: 470px;
    overflow: hidden;
    padding: 28px;
    position: relative;
    width: min(calc(100vw - 48px), 470px);
}

.trw-smart-loader-panel::before {
    background: linear-gradient(90deg, #0d5c36 0 58%, #e31e24 58% 82%, #f7c41f 82% 100%);
    content: "";
    height: 6px;
    inset: 0 0 auto;
    position: absolute;
}

.trw-smart-loader-brand {
    align-items: center;
    display: flex;
    gap: 16px;
    min-width: 0;
}

.trw-smart-loader-brand > div {
    min-width: 0;
}

.trw-smart-loader-brand strong {
    color: #123223;
    display: block;
    font-size: .96rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.trw-smart-loader-kicker {
    color: #9f1820;
    display: block;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .08em;
    margin-bottom: 3px;
}

.trw-smart-loader-logo-wrap {
    align-items: center;
    background: #fff;
    border: 1px solid #d8e5dc;
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 62px;
    height: 62px;
    justify-content: center;
    position: relative;
    width: 62px;
}

.trw-smart-loader-logo {
    height: 42px;
    object-fit: contain;
    position: relative;
    width: 42px;
    z-index: 2;
}

.trw-smart-loader-ring {
    border: 2px solid transparent;
    border-radius: 50%;
    inset: -7px;
    position: absolute;
}

.trw-smart-loader-ring-one {
    animation: trw-loader-spin 1.4s linear infinite;
    border-left-color: #0d5c36;
    border-top-color: #0d5c36;
}

.trw-smart-loader-ring-two {
    animation: trw-loader-spin-reverse 2s linear infinite;
    border-bottom-color: #e31e24;
    border-right-color: #f7c41f;
    inset: -12px;
}

.trw-smart-loader-visual {
    align-items: end;
    display: flex;
    gap: 5px;
    height: 34px;
    margin: 31px 0 18px;
}

.trw-smart-loader-visual span {
    animation: trw-loader-pulse 1.15s ease-in-out infinite;
    background: #0d5c36;
    border-radius: 2px 2px 0 0;
    display: block;
    height: 35%;
    width: 8px;
}

.trw-smart-loader-visual span:nth-child(2) { animation-delay: .12s; background: #157748; }
.trw-smart-loader-visual span:nth-child(3) { animation-delay: .24s; background: #f7c41f; }
.trw-smart-loader-visual span:nth-child(4) { animation-delay: .36s; background: #e31e24; }
.trw-smart-loader-visual span:nth-child(5) { animation-delay: .48s; background: #0d5c36; }

.trw-smart-loader h2 {
    color: #0a2d1c;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 9px;
}

.trw-smart-loader p {
    color: #4b6256;
    font-size: .94rem;
    line-height: 1.55;
    margin: 0;
}

.trw-smart-loader-progress {
    background: #dfe9e2;
    border-radius: 999px;
    height: 7px;
    margin: 23px 0 15px;
    overflow: hidden;
    position: relative;
}

.trw-smart-loader-progress span {
    animation: trw-loader-progress 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, #0d5c36, #f7c41f, #e31e24);
    border-radius: inherit;
    height: 100%;
    left: -45%;
    position: absolute;
    width: 45%;
}

.trw-smart-loader-status {
    align-items: center;
    color: #486254;
    display: flex;
    font-size: .78rem;
    font-weight: 800;
    gap: 8px;
}

.trw-smart-loader-status-dot {
    animation: trw-loader-dot 1.25s ease-in-out infinite;
    background: #159447;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(21, 148, 71, .12);
    flex: 0 0 8px;
    height: 8px;
    width: 8px;
}

.trw-smart-loader-recovery {
    align-items: start;
    background: #fff9df;
    border: 1px solid #f1d76b;
    border-radius: 7px;
    display: grid;
    gap: 12px;
    grid-template-columns: 34px minmax(0, 1fr);
    margin-top: 20px;
    padding: 14px;
}

.trw-smart-loader-recovery[hidden] {
    display: none !important;
}

.trw-smart-loader-recovery-icon {
    align-items: center;
    background: #f7c41f;
    border-radius: 50%;
    color: #302300;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.trw-smart-loader-recovery strong,
.trw-smart-loader-recovery span {
    display: block;
}

.trw-smart-loader-recovery strong {
    color: #5f4700;
    font-size: .9rem;
    margin-bottom: 3px;
}

.trw-smart-loader-recovery span {
    color: #775f17;
    font-size: .78rem;
    line-height: 1.45;
}

.trw-smart-loader-recovery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-column: 1 / -1;
}

.trw-smart-loader-btn {
    align-items: center;
    background: #fff;
    border: 1px solid #c8d5cc;
    border-radius: 6px;
    color: #254735;
    display: inline-flex;
    font-size: .77rem;
    font-weight: 900;
    gap: 6px;
    justify-content: center;
    min-height: 36px;
    padding: 7px 11px;
}

.trw-smart-loader-btn:hover,
.trw-smart-loader-btn:focus-visible {
    background: #edf5ef;
    border-color: #0d5c36;
    color: #0a4227;
}

.trw-smart-loader-btn-primary {
    background: #0d5c36;
    border-color: #0d5c36;
    color: #fff;
}

.trw-smart-loader-btn-primary:hover,
.trw-smart-loader-btn-primary:focus-visible {
    background: #083f25;
    color: #fff;
}

body.trw-smart-loader-active {
    overflow: hidden !important;
}

.trw-loader-submit-pending {
    cursor: wait !important;
    opacity: .78;
    pointer-events: none !important;
}

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

@keyframes trw-loader-spin-reverse {
    to { transform: rotate(-360deg); }
}

@keyframes trw-loader-pulse {
    0%, 100% { height: 30%; opacity: .55; }
    50% { height: 100%; opacity: 1; }
}

@keyframes trw-loader-progress {
    0% { left: -45%; }
    100% { left: 105%; }
}

@keyframes trw-loader-dot {
    0%, 100% { opacity: .55; transform: scale(.9); }
    50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 575.98px) {
    .trw-smart-loader {
        padding: 14px;
    }

    .trw-smart-loader-panel {
        padding: 24px 20px;
        width: min(calc(100vw - 28px), 470px);
    }

    .trw-smart-loader-brand {
        gap: 13px;
    }

    .trw-smart-loader-logo-wrap {
        flex-basis: 54px;
        height: 54px;
        width: 54px;
    }

    .trw-smart-loader-logo {
        height: 36px;
        width: 36px;
    }

    .trw-smart-loader-recovery-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trw-smart-loader,
    .trw-smart-loader-ring,
    .trw-smart-loader-visual span,
    .trw-smart-loader-progress span,
    .trw-smart-loader-status-dot {
        animation: none !important;
        transition: none !important;
    }

    .trw-smart-loader-progress span {
        left: 0;
        width: 72%;
    }
}

@media print {
    .trw-smart-loader {
        display: none !important;
    }
}
