/**
 * WR Order Form — Styles
 * Clean, compact, professional, mobile-responsive.
 */

/* ===== Reset & Base ===== */
.wr-order-app {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
}

.wr-order-app *,
.wr-order-app *::before,
.wr-order-app *::after {
    box-sizing: border-box;
}

/* ===== Test Mode Banner ===== */
.wr-test-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.wr-test-banner code {
    background: #ffeeba;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

/* ===== Progress Bar ===== */
.wr-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0;
}

.wr-progress__step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.wr-progress__step--active {
    opacity: 1;
}

.wr-progress__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s;
}

.wr-progress__step--active .wr-progress__number {
    background: #2563eb;
    color: #fff;
}

.wr-progress__label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.wr-progress__step--active .wr-progress__label {
    color: #1e293b;
}

.wr-progress__line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.75rem;
    min-width: 30px;
}

/* ===== Form Row Layout ===== */
.wr-form-row {
    display: flex;
    gap: 1rem;
}

.wr-form-row--2col>.wr-field {
    flex: 1;
    min-width: 0;
}

/* ===== Form Fields ===== */
.wr-field {
    margin-bottom: 1rem;
}

.wr-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 0.3rem;
    color: #1e293b;
}

.wr-required {
    color: #ef4444;
}

.wr-field input[type="email"],
.wr-field input[type="url"],
.wr-field input[type="text"],
.wr-field input[type="number"],
.wr-field select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.wr-field input[type="number"] {
    -moz-appearance: textfield;
}

.wr-field input:focus,
.wr-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wr-field--error input,
.wr-field--error select {
    border-color: #ef4444;
}

.wr-error {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 0.2rem;
    min-height: 0;
}

.wr-help {
    font-size: 12px;
    color: #64748b;
    margin: 0.2rem 0 0;
}

.wr-help a {
    color: #2563eb;
    text-decoration: none;
}

.wr-help a:hover {
    text-decoration: underline;
}

/* ===== Radio Cards (Service Type — compact) ===== */
.wr-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wr-radio-group--compact {
    flex-direction: row;
}

.wr-radio-group--inline {
    flex-direction: row;
}

.wr-radio-group--stacked {
    flex-direction: column;
    gap: 0.4rem;
}

.wr-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wr-radio-card--compact {
    flex: 1;
    padding: 0.65rem 0.85rem;
}

.wr-radio-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.wr-radio-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.wr-radio-card input {
    margin-top: 3px;
    accent-color: #2563eb;
}

.wr-radio-card__body {
    flex: 1;
}

.wr-radio-card__body strong {
    display: block;
    font-size: 14px;
}

.wr-radio-card__price {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    margin-top: 0.1rem;
}

.wr-radio-card__body p {
    font-size: 12px;
    color: #64748b;
    margin: 0.2rem 0 0;
}

/* ===== Radio Pills (Delivery) ===== */
.wr-radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 99px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.wr-radio-pill:hover {
    border-color: #93c5fd;
}

.wr-radio-pill:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1e40af;
}

.wr-radio-pill input {
    accent-color: #2563eb;
}

/* ===== Checkbox Cards (Add-ons) ===== */
.wr-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wr-checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wr-checkbox-card:hover {
    border-color: #93c5fd;
}

.wr-checkbox-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.wr-checkbox-card input {
    accent-color: #2563eb;
}

.wr-checkbox-card div {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wr-checkbox-card strong {
    font-size: 13px;
}

.wr-addon-price {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
}

/* ===== Price Summary ===== */
.wr-price-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
}

.wr-price-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 0.25rem 0;
    color: #475569;
}

.wr-price-summary__total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    padding-top: 0.5rem;
    margin-top: 0.4rem;
    border-top: 1.5px solid #e2e8f0;
    color: #1e293b;
}

/* ===== Trust Signals — Enhanced ===== */
.wr-trust {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.wr-trust__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-align: left;
}

.wr-trust__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.wr-trust__item div {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.wr-trust__item strong {
    font-size: 12px;
    color: #166534;
}

.wr-trust__item span {
    font-size: 11px;
    color: #4ade80;
}

.wr-trust__item div>strong+span {
    color: #15803d;
}

/* ===== Buttons ===== */
.wr-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.wr-btn--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.wr-btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.wr-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wr-btn--lg {
    padding: 0.9rem;
    font-size: 16px;
}

.wr-btn--secondary {
    background: #f1f5f9;
    color: #475569;
    margin-top: 0.75rem;
}

.wr-btn--secondary:hover {
    background: #e2e8f0;
}

.wr-btn--link {
    background: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    padding: 0.5rem;
    width: auto;
    text-decoration: underline;
}

.wr-btn--link:hover {
    color: #1e293b;
}

/* ===== Form Error ===== */
.wr-form-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 14px;
    border: 1px solid #fee2e2;
}

/* ===== Redirect Note ===== */
.wr-redirect-note {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 0.75rem 0 0;
    padding: 0;
}

/* ===== Pending Order Banner ===== */
.wr-pending-banner {
    background: #fffbeb;
    border: 1.5px solid #fbbf24;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.wr-pending-banner p {
    margin: 0 0 1rem;
    font-size: 15px;
    color: #92400e;
}

.wr-pending-banner__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.wr-pending-banner__actions .wr-btn--primary {
    width: auto;
    display: inline-block;
    padding: 0.75rem 2rem;
    text-decoration: none;
}

/* ===== Verifying Step ===== */
.wr-verifying {
    text-align: center;
    padding: 3rem 1rem;
}

.wr-verifying h2 {
    margin: 1.25rem 0 0.5rem;
    font-size: 20px;
    color: #1e293b;
}

.wr-verifying p {
    color: #64748b;
    font-size: 14px;
}

.wr-verifying__spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: wr-spin 0.8s linear infinite;
}

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

/* ===== Confirmation Processing Note ===== */
.wr-confirmation__processing {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    font-size: 13px;
}

/* ===== Payment Step ===== */
.wr-order-locked {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.wr-order-locked h3 {
    margin: 0 0 0.5rem;
    font-size: 15px;
    color: #1e293b;
}

.wr-order-locked p {
    margin: 0.25rem 0;
    font-size: 14px;
    color: #475569;
}

.wr-order-locked__total {
    font-size: 16px;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Checkout Iframe */
.wr-checkout-embed {
    min-height: 400px;
    margin-bottom: 1rem;
}

.wr-checkout-iframe {
    width: 100%;
    min-height: 500px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

/* ===== Confirmation Step ===== */
.wr-confirmation {
    text-align: center;
    padding: 2rem 0;
}

.wr-confirmation__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.wr-confirmation h2 {
    margin: 0 0 0.5rem;
    font-size: 24px;
    color: #065f46;
}

.wr-confirmation__ref {
    font-size: 16px;
    color: #475569;
    margin-bottom: 1.5rem;
}

.wr-confirmation__details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    display: inline-block;
    text-align: left;
    margin-bottom: 1rem;
}

.wr-confirmation__details p {
    margin: 0.25rem 0;
    font-size: 14px;
}

.wr-confirmation__email {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 1.5rem;
}

.wr-confirmation__next {
    text-align: left;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.wr-confirmation__next h3 {
    margin: 0 0 0.75rem;
    font-size: 15px;
    color: #1e40af;
}

.wr-confirmation__next ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #1e293b;
    font-size: 14px;
}

.wr-confirmation__next li {
    margin-bottom: 0.4rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .wr-order-app {
        padding: 0 1rem;
    }

    .wr-progress__label {
        display: none;
    }

    .wr-form-row {
        flex-direction: column;
        gap: 0;
    }

    .wr-radio-group--compact {
        flex-direction: column;
    }

    .wr-radio-group--inline {
        flex-direction: column;
    }

    .wr-trust {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .wr-checkbox-card div {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
}

/* ---- Dynamic archive URL fields ---- */
.wr-archive-url-item {
    margin-bottom: 0.5rem;
}

.wr-archive-url-item:last-child {
    margin-bottom: 0;
}

.wr-archive-url-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.2rem;
    min-height: 1em;
}