/* Universal Returns – Frontend Styles
   ================================================= */

/* ── Trigger Button ──────────────────────────────── */
.ur-trigger-wrap {
    display: inline-block;
    margin: 8px 0;
}

.ur-trigger-btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .3px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: lowercase;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 3px 10px rgba(0,0,0,.2);
    outline-offset: 3px;
}

/* Rozmiary przycisku */
.ur-btn--small  { padding: 8px 16px;  font-size: 13px; border-radius: 5px; }
.ur-btn--medium { padding: 13px 26px; font-size: 15px; border-radius: 6px; }
.ur-btn--large  { padding: 18px 36px; font-size: 18px; border-radius: 8px; }

.ur-trigger-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0,0,0,.25);
}

.ur-trigger-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.ur-trigger-btn:focus-visible {
    outline: 3px solid #ffd700;
}

/* ── Modal Overlay ───────────────────────────────── */
/* FIX: modal domyślnie ukryty przez CSS – nie przez inline style.
   Dzięki temu popup NIE otwiera się sam przed załadowaniem JS. */
.ur-modal-overlay {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.ur-modal-overlay.ur-modal--open {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(10, 10, 20, .72) !important;
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
    backdrop-filter: blur(3px);
    animation: ur-overlay-in .2s ease;
}

@keyframes ur-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Box ───────────────────────────────────── */
.ur-modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
    animation: ur-box-in .25s cubic-bezier(.34,1.26,.64,1);
}

@keyframes ur-box-in {
    from { transform: scale(.94) translateY(12px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* ── Modal Close ─────────────────────────────────── */
.ur-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    z-index: 1;
}

.ur-modal-close:hover { color: #333; background: #f0f0f0; }
.ur-modal-close:focus-visible { outline: 2px solid #c0392b; }

/* ── Modal Header ────────────────────────────────── */
.ur-modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 32px 32px 28px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    color: #fff;
}

.ur-modal-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.ur-modal-header h2 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.ur-modal-subtitle {
    margin: 0;
    font-size: 12.5px;
    color: rgba(255,255,255,.72);
    line-height: 1.6;
}

/* ── Form ────────────────────────────────────────── */
#ur-return-form {
    padding: 28px 32px 32px;
}

.ur-form-group {
    margin-bottom: 18px;
}

.ur-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.ur-required { color: #c0392b; }

.ur-form-group input[type="text"],
.ur-form-group input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 15px;
    font-family: inherit;
    color: #222;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.ur-form-group input:focus {
    outline: none;
    border-color: #c0392b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}

.ur-form-group input.ur-input-error {
    border-color: #c0392b;
    background: #fff8f8;
}

.ur-field-error {
    display: block;
    font-size: 12px;
    color: #c0392b;
    margin-top: 4px;
    min-height: 16px;
}

/* ── Legal box ───────────────────────────────────── */
.ur-legal-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 14px 16px;
    margin: 20px 0;
}

.ur-legal-box p {
    margin: 0;
    font-size: 12.5px;
    color: #666;
    line-height: 1.65;
}

/* ── Messages ────────────────────────────────────── */
.ur-message {
    border-radius: 7px;
    padding: 13px 16px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.ur-message.ur-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ur-message.ur-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ── Submit Button ───────────────────────────────── */
.ur-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #c0392b 0%, #96281b 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-transform: lowercase;
    letter-spacing: .3px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 3px 12px rgba(192,57,43,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ur-submit-btn:hover:not(:disabled) {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(192,57,43,.4);
}

.ur-submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.ur-submit-btn:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

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

.ur-submit-spinner {
    display: inline-block;
    animation: ur-spin .8s linear infinite;
    font-size: 16px;
}

/* ── My Account "Zwrot" button ───────────────────── */
.ur-myaccount-return {
    background: #c0392b !important;
    color: #fff !important;
    border-color: #c0392b !important;
}

.ur-myaccount-return:hover {
    background: #96281b !important;
    border-color: #96281b !important;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 560px) {
    .ur-modal-box { border-radius: 10px; }
    .ur-modal-header { padding: 24px 20px 20px; }
    #ur-return-form { padding: 22px 20px 24px; }
    .ur-modal-header h2 { font-size: 17px; }
}

/* v2 additions ────────────────────────────────────────── */
#ur-return-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    color: #333;
    appearance: auto;
    -webkit-appearance: auto;
    cursor: pointer;
    transition: border-color .2s;
}
#ur-return-form select:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
#ur-return-form select.ur-input-error {
    border-color: #c0392b;
}
#ur-product-group {
    animation: urSlideIn .2s ease;
}
@keyframes urSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
#ur-expired-notice {
    margin-bottom: 16px;
    font-weight: 600;
}

/* ── Odznaka zwrotu przy zamówieniu ──────────────── */
.ur-return-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 4px;
}

.ur-return-badge.ur-badge--accepted {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

.ur-return-badge.ur-badge--rejected {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

/* ── Potwierdzenie sukcesu (poza formularzem) ─────── */
.ur-success-box {
    text-align: center;
    padding: 32px 24px 24px;
    animation: ur-fadein .4s ease;
}

.ur-success-icon {
    font-size: 52px;
    color: #27ae60;
    margin-bottom: 12px;
    line-height: 1;
}

.ur-success-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.ur-success-body {
    font-size: 15px;
    color: #444;
    margin: 0 0 14px;
    line-height: 1.6;
}

.ur-success-email-note {
    font-size: 13px;
    color: #666;
    background: #f0f9f4;
    border: 1px solid #a8e6bf;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0;
    line-height: 1.5;
}

@keyframes ur-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Math Captcha ─────────────────────────────────────────────────────────── */
.ur-captcha-group {
    background: #f8f9ff;
    border: 1px solid #d0d7ff;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 4px;
}

.ur-captcha-group label {
    display: block;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 8px;
}

.ur-captcha-group label strong {
    color: #2563eb;
    font-size: 1.05rem;
    font-family: monospace;
    background: #e8eeff;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ── Dyskretny komunikat sukcesu dla gości ───────────────────────────────── */
.ur-discreet-success {
    text-align: center;
    padding: 24px 20px;
    animation: ur-fade-in 0.4s ease;
}

.ur-discreet-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.ur-discreet-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 12px;
}

.ur-discreet-msg {
    font-size: 0.97rem;
    color: #374151;
    line-height: 1.6;
    margin: 0 0 12px;
    padding: 12px 16px;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    border-radius: 0 6px 6px 0;
    text-align: left;
}

.ur-discreet-hint {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* ── Captcha refresh button ───────────────────────────────────────────────── */
.ur-captcha-refresh-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 4px 0;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ur-captcha-refresh-btn:hover { opacity: 1; }
.ur-captcha-refresh-btn:disabled { opacity: 0.4; cursor: not-allowed; }
