/* === PG Returns Form v1.3.0 === */
:root {
    --pgr-primary:    #111111;
    --pgr-secondary:  #444444;
    --pgr-accent:     #1a56db;
    --pgr-border:     #e2e8f0;
    --pgr-bg:         #f8fafc;
    --pgr-card:       #ffffff;
    --pgr-radius:     10px;
    --pgr-shadow:     0 1px 4px rgba(0,0,0,.07);
    --pgr-focus-ring: 0 0 0 3px rgba(26,86,219,.15);
}

/* ── Form wrapper ────────────────────────────────────── */
.pg-returns-form {
    max-width: 720px;
    font-family: inherit;
    color: #1a202c;
}

/* ── Alerts ──────────────────────────────────────────── */
.pgr-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--pgr-radius);
    margin-bottom: 20px;
    font-size: .93rem;
    line-height: 1.5;
}
.pgr-alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.pgr-ok  { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.pgr-err { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Law notice ──────────────────────────────────────── */
.pgr-law-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--pgr-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: .88rem;
    color: #1e40af;
    line-height: 1.65;
}

/* ── Fieldsets ───────────────────────────────────────── */
.pgr-fieldset {
    border: 1px solid var(--pgr-border);
    border-radius: var(--pgr-radius);
    margin-bottom: 16px;
    padding: 20px 22px;
    background: var(--pgr-card);
    box-shadow: var(--pgr-shadow);
}

.pgr-legend {
    font-weight: 700;
    font-size: .93rem;
    padding: 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111;
    text-align: left;
}
.pgr-legend-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--pgr-primary);
    color: #fff;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.pgr-legend-hint {
    font-weight: 400;
    font-size: .8rem;
    color: #6b7280;
}

/* ── Labels & inputs ─────────────────────────────────── */
.pgr-label {
    display: block;
    margin-bottom: 14px;
    font-size: .86rem;
    font-weight: 600;
    color: #374151;
}
.pgr-label input,
.pgr-label select,
.pgr-label textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 9px 12px;
    border: 1.5px solid var(--pgr-border);
    border-radius: 7px;
    font-size: .9rem;
    background: #fff;
    color: #111;
    font-family: inherit;
    min-height: 42px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.pgr-label input:focus,
.pgr-label select:focus,
.pgr-label textarea:focus {
    outline: none;
    border-color: var(--pgr-accent);
    box-shadow: var(--pgr-focus-ring);
}
.pgr-label textarea { min-height: 80px; resize: vertical; }
.pgr-label input[type="date"] { color: #374151; }

.pgr-input-qty { max-width: 110px !important; text-align: center; }

.pgr-field-hint {
    display: block;
    font-size: .76rem;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 400;
    line-height: 1.4;
}

/* ── Layout helpers ──────────────────────────────────── */
.pgr-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.pgr-label-half { max-width: 50%; }
.pgr-qty-label  { max-width: 150px; }

/* ── Return type cards ───────────────────────────────── */
.pgr-return-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 6px;
}
.pgr-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--pgr-border);
    border-radius: var(--pgr-radius);
    cursor: pointer;
    background: var(--pgr-bg);
    font-size: .86rem;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.pgr-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pgr-type-card.pgr-type-selected {
    border-color: var(--pgr-primary);
    background: #f0f0f0;
}
.pgr-type-icon { font-size: 1.5rem; flex-shrink: 0; }
.pgr-type-card strong { display: block; margin-bottom: 3px; font-size: .88rem; }
.pgr-type-card small  { color: #6b7280; font-size: .78rem; }

/* ── Info boxes ──────────────────────────────────────── */
.pgr-info-box {
    border-radius: 7px;
    padding: 10px 14px;
    font-size: .84rem;
    line-height: 1.55;
    margin-bottom: 14px;
}
.pgr-info-green { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.pgr-info-blue  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Fetch row ───────────────────────────────────────── */
.pgr-fetch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
#pgr-lookup-status { font-size: .82rem; color: #0a7a3d; }
.pgr-expired-warn {
    display: block;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: var(--pgr-radius);
    padding: 16px 18px;
    font-size: .9rem;
    line-height: 1.7;
    margin-top: 8px;
}
.pgr-expired-warn a { color: #7f1d1d; font-weight: 700; text-decoration: underline; }

/* ── Items list ──────────────────────────────────────── */
.pgr-items-wrap {
    border: 1.5px solid var(--pgr-border);
    border-radius: var(--pgr-radius);
    padding: 14px;
    margin-bottom: 14px;
    background: var(--pgr-bg);
}
.pgr-items-head {
    font-weight: 700;
    font-size: .88rem;
    margin-bottom: 10px;
    color: #374151;
}
.pgr-item {
    display: grid;
    grid-template-columns: 28px 1fr 110px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 6px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
    cursor: pointer;
}
.pgr-item-check {
    transform: scale(1.2);
    accent-color: var(--pgr-primary);
}
.pgr-item-name {
    font-weight: 600;
    font-size: .86rem;
    line-height: 1.4;
}
.pgr-item-qty {
    width: 110px;
    height: 38px;
    padding: 6px 10px;
    border: 1.5px solid var(--pgr-border);
    border-radius: 6px;
    font-size: .88rem;
    text-align: center;
    box-sizing: border-box;
    transition: border-color .15s;
}
.pgr-item-qty:focus { outline: none; border-color: var(--pgr-accent); box-shadow: var(--pgr-focus-ring); }
.pgr-sku { font-size: .78rem; color: #9ca3af; }

/* ── Hint text ───────────────────────────────────────── */
.pgr-hint { font-size: .8rem; color: #6b7280; margin: 4px 0; }

/* ── File upload ─────────────────────────────────────── */
.pgr-file-wrap input[type="file"] {
    display: block;
    padding: 6px 0;
    font-size: .86rem;
    color: #374151;
}

/* ── Consent ─────────────────────────────────────────── */
.pgr-consent-wrap {
    margin: 20px 0;
}
.pgr-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .86rem;
    cursor: pointer;
    line-height: 1.55;
    color: #374151;
}
.pgr-consent input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
    transform: scale(1.2);
    accent-color: var(--pgr-primary);
}
.pgr-consent a { color: var(--pgr-accent); text-decoration: underline; }
.pgr-gdpr-note {
    font-size: .76rem;
    color: #9ca3af;
    margin: 8px 0 0 28px;
    line-height: 1.5;
}

/* ── Buttons ─────────────────────────────────────────── */
.pgr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--pgr-primary);
    color: #fff;
    transition: opacity .15s;
    font-family: inherit;
    letter-spacing: .01em;
}
.pgr-btn:hover { opacity: .82; }
.pgr-btn-secondary { background: var(--pgr-secondary); }
.pgr-btn-submit {
    display: flex;
    width: 100%;
    height: 52px;
    font-size: .97rem;
    letter-spacing: .02em;
    border-radius: var(--pgr-radius);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .pgr-fieldset { padding: 16px; }
    .pgr-two-col   { grid-template-columns: 1fr; }
    .pgr-return-type { grid-template-columns: 1fr; }
    .pgr-label-half { max-width: 100%; }
    .pgr-qty-label  { max-width: 100%; }
    .pgr-item { grid-template-columns: 24px 1fr; grid-template-rows: auto auto; }
    .pgr-item-qty { grid-column: 2; justify-self: start; }
    .pgr-fetch-row { flex-direction: column; align-items: flex-start; }
}
