/* EU Withdrawal Button — Frontend Styles
   Mobile-first, inherits theme colors where possible */

/* ---------- Form wrapper ---------- */
.ewb-form-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-size: 15px;
}

/* ---------- Legal info banner ---------- */
.ewb-legal-info {
    background: #f0f4f8;
    border-left: 4px solid #0073aa;
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}
.ewb-legal-info p { margin: 0; }

/* ---------- Notices ---------- */
.ewb-notice {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.ewb-notice--success {
    background: #edfbea;
    border: 1px solid #5ab45a;
    color: #2d6a2d;
}
.ewb-notice--error {
    background: #fdf0f0;
    border: 1px solid #d9534f;
    color: #a02020;
}

/* ---------- Form fields ---------- */
.ewb-form .ewb-field {
    margin-bottom: 16px;
}
.ewb-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 7px;
    color: #1a2340;
    font-size: 14px;
}

/* All inputs share base style */
.ewb-form input[type="text"],
.ewb-form input[type="email"],
.ewb-form input[type="date"],
.ewb-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1.5px solid #dde3ef;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    background-color: #fff;
    color: #1a2340;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
    -webkit-appearance: none;
}
.ewb-form input[type="text"]:focus,
.ewb-form input[type="email"]:focus,
.ewb-form input[type="date"]:focus,
.ewb-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}
.ewb-form input[type="text"]::placeholder,
.ewb-form input[type="email"]::placeholder,
.ewb-form input[type="date"]::placeholder,
.ewb-form textarea::placeholder {
    color: #9aa3b8;
}
.ewb-form input[readonly] {
    background-color: #f5f7fc;
    color: #6b7280;
    cursor: default;
}

/* ---------- Icon inputs ---------- */

/* Wrapper uses flex so icon and input sit in a row */
.ewb-field-wrap {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    /* Border and radius live on the wrapper, not the input */
    border: 1.5px solid #dde3ef !important;
    border-radius: 12px !important;
    background: #fff !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
    overflow: hidden !important;
}
.ewb-field-wrap:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}

/* Icon column — fixed width, never shrinks */
.ewb-field-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 46px !important;
    min-width: 46px !important;
    flex-shrink: 0 !important;
    color: #9aa3b8 !important;
    pointer-events: none !important;
    transition: color 0.18s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}
.ewb-field-wrap:focus-within .ewb-field-icon {
    color: #2563eb !important;
}
.ewb-field-icon svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* Input inside wrapper: no border/radius (wrapper handles it), just fills the space */
.ewb-field-wrap .ewb-icon-input {
    flex: 1 1 auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
    padding-left: 0 !important;
    padding-right: 16px !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
}
.ewb-field-wrap .ewb-icon-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ---------- Misc helpers ---------- */
.ewb-required { color: #e53e3e; margin-left: 3px; }
.ewb-optional { font-weight: 400; color: #9aa3b8; font-size: 13px; margin-left: 4px; }
.ewb-field-note { font-size: 12px; color: #7b8ab8; margin: 5px 0 0; }

/* ---------- Checkboxes ---------- */
.ewb-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.ewb-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    cursor: pointer;
    line-height: 1.5;
}
.ewb-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: #0073aa;
    cursor: pointer;
}

/* ---------- Radio buttons ---------- */
.ewb-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.ewb-radio-label {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 400 !important;
    transition: border-color 0.15s ease, background 0.15s ease;
    line-height: 1;
}
.ewb-radio-label:hover { border-color: #0073aa; background: #f5faff; }
.ewb-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: #0073aa;
    cursor: pointer;
}
.ewb-radio-label input[type="radio"]:checked + .ewb-radio-title { color: #0073aa; }
.ewb-radio-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
}
.ewb-radio-desc {
    display: block;
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

/* ---------- Submit ---------- */
.ewb-submit-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}
.ewb-btn-submit,
.ewb-btn-return,
a.ewb-btn-return,
a.ewb-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    background: #2c3e50;
    color: #fff !important;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.15s ease, transform 0.1s ease;
    line-height: 1;
    min-height: 48px; /* Accessible tap target */
}
.ewb-btn-submit:hover,
.ewb-btn-return:hover,
a.ewb-btn-return:hover { background: #1a252f; }
.ewb-btn-submit:active { transform: scale(0.98); }
.ewb-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Spinner ---------- */
.ewb-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,115,170,.3);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ewb-spin 0.7s linear infinite;
}
@keyframes ewb-spin { to { transform: rotate(360deg); } }

/* ---------- Privacy note ---------- */
.ewb-privacy-note {
    font-size: 12px;
    color: #999;
    margin-top: 16px;
}
.ewb-privacy-note a { color: #0073aa; }

/* ---------- Order detail CTA ---------- */
.ewb-order-detail-cta {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}
.ewb-withdrawal-note {
    font-size: 13px;
    color: #777;
    margin: 12px 0 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .ewb-btn-submit,
    .ewb-btn-return,
    a.ewb-btn-return {
        width: 100%;
        text-align: center;
    }
    .ewb-submit-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .ewb-radio-group { gap: 8px; }
}

/* ---------- Status buttons (order list + order detail) ---------- */
.ewb-status-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: default !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    pointer-events: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Larger variant used on order detail page */
.ewb-status-btn--large {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
}

.ewb-status-pending {
    background: #fff3cd !important;
    color: #7d5800 !important;
    border: 1px solid #f0c030 !important;
}
.ewb-status-approved {
    background: #d1e7dd !important;
    color: #0a4a28 !important;
    border: 1px solid #75c49a !important;
}
.ewb-status-rejected {
    background: #f8d7da !important;
    color: #7a1921 !important;
    border: 1px solid #f19097 !important;
}
.ewb-status-completed {
    background: #cff4fc !important;
    color: #084462 !important;
    border: 1px solid #7ed6ef !important;
}
