/* 1.8.6: /remesa/ y /remesa-enviada/. Claro por defecto; oscuro con html.dark-mode.
   Móvil: una columna (cantidad → datos → pagar). Escritorio: datos a la izquierda y
   cantidad + pago fijos a la derecha, como el checkout. */
.zrm {
    --zrm-bg: #ffffff;
    --zrm-soft: #f6f7f9;
    --zrm-ink: #111827;
    --zrm-muted: #6b7280;
    --zrm-line: #dfe3e8;
    --zrm-field: #ffffff;
    --zrm-field-line: #c9ced6;
    --zrm-accent: #ffcc00;
    --zrm-accent-ink: #111827;
    --zrm-bad: #dc2626;
    max-width: 1080px;
    margin: 32px auto 72px;
    padding: 0 16px;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--zrm-ink);
}
html.dark-mode .zrm {
    --zrm-bg: #1a1d23;
    --zrm-soft: #14171c;
    --zrm-ink: #eef1f5;
    --zrm-muted: #9aa3b2;
    --zrm-line: #323844;
    --zrm-field: #252830;
    --zrm-field-line: #4b5563;
    --zrm-bad: #f87171;
}
.zrm *, .zrm *::before, .zrm *::after { box-sizing: border-box; }

/* ── Estructura ── */
.zrm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "amount" "main" "pay";
    gap: 16px;
}
.zrm-head { grid-area: head; }
.zrm-main { grid-area: main; }
.zrm-side { display: contents; }
.zrm-amount { grid-area: amount; }
.zrm-pay { grid-area: pay; }

@media (min-width: 900px) {
    .zrm-layout {
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-areas: "head head" "main side";
        column-gap: 28px;
        row-gap: 22px;
        align-items: start;
    }
    .zrm-side { display: flex; flex-direction: column; gap: 16px; grid-area: side; position: sticky; top: 96px; }
    .zrm-amount, .zrm-pay { grid-area: auto; }
    .zrm-head { padding-top: 8px; }
    .zrm h1 { font-size: 32px; }
}

.zrm-panel {
    background: var(--zrm-bg);
    border: 1px solid var(--zrm-line);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 14px 34px rgba(17, 24, 39, .06);
}
html.dark-mode .zrm-panel { box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
.zrm-amount { border-top: 4px solid var(--zrm-accent); }

/* ── Cabecera ── */
.zrm-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 204, 0, .18);
    color: #8a6500;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
html.dark-mode .zrm-eyebrow { color: #ffcc00; }
.zrm h1 { margin: 0 0 6px; font-size: 27px; line-height: 1.2; font-weight: 800; color: var(--zrm-ink); }
.zrm-head p, .zrm-done p { margin: 0; color: var(--zrm-muted); line-height: 1.5; }
.zrm h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--zrm-ink); }

/* ── Cantidad ── */
.zrm-amount > label { display: block; margin-bottom: 10px; font-weight: 700; }
.zrm-amount-input {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 64px;
    padding: 0 16px;
    border: 2px solid var(--zrm-field-line);
    border-radius: 12px;
    background: var(--zrm-field);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.zrm-amount-input:focus-within { border-color: var(--zrm-accent); box-shadow: 0 0 0 4px rgba(255, 204, 0, .22); }
.zrm-amount-input span { font-size: 26px; font-weight: 800; color: var(--zrm-muted); }
.zrm-amount-input b { font-size: 14px; color: var(--zrm-muted); }
.zrm .zrm-amount-input input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0;
    color: var(--zrm-ink) !important;
    font-size: 28px;
    font-weight: 800;
}
.zrm-amount.zrm-invalid .zrm-amount-input { border-color: var(--zrm-bad); }
.zrm-usd-note { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: rgba(22, 163, 74, .09); color: #166534; font-size: 14px; line-height: 1.4; }
html.dark-mode .zrm-usd-note { background: rgba(34, 197, 94, .1); color: #86efac; }

.zrm-calc { margin: 16px 0 0; padding: 0; }
.zrm-calc > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; }
.zrm-calc dt { color: var(--zrm-muted); }
.zrm-calc dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zrm-calc .zrm-total { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--zrm-line); font-size: 18px; }
.zrm-calc .zrm-total dt { color: var(--zrm-ink); font-weight: 800; }
.zrm-calc .zrm-total dd { font-weight: 900; }
html.dark-mode .zrm-calc .zrm-total dd { color: #ffcc00; }

/* ── Datos ── */
.zrm-block + .zrm-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--zrm-line); }
.zrm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
@media (min-width: 700px) {
    .zrm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}
.zrm-field { display: block; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--zrm-ink); }
.zrm-label { display: block; }
.zrm .zrm-field input,
.zrm .zrm-field textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 13px;
    border: 1px solid var(--zrm-field-line) !important;
    border-radius: 10px !important;
    background: var(--zrm-field) !important;
    color: var(--zrm-ink) !important;
    font: inherit;
    font-weight: 400;
    font-size: 16px;
    box-shadow: none !important;
    outline: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.zrm .zrm-field input { height: 50px; }
.zrm .zrm-field .zrm-select { display: block; width: 100%; height: 50px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--zrm-field-line) !important; border-radius: 10px !important; background-color: var(--zrm-field) !important; color: var(--zrm-ink) !important; font: inherit; font-size: 16px; font-weight: 400; box-shadow: none !important; outline: 0; }
.zrm .zrm-field .zrm-select:focus { border-color: var(--zrm-accent) !important; box-shadow: 0 0 0 3px rgba(255, 204, 0, .22) !important; }
.zrm-field.zrm-invalid .zrm-select { border-color: var(--zrm-bad) !important; }
.zrm .zrm-field textarea { min-height: 88px; resize: vertical; }
.zrm .zrm-field input:focus,
.zrm .zrm-field textarea:focus { border-color: var(--zrm-accent) !important; box-shadow: 0 0 0 3px rgba(255, 204, 0, .22) !important; }
.zrm .zrm-field input:-webkit-autofill { -webkit-text-fill-color: var(--zrm-ink); -webkit-box-shadow: 0 0 0 40px var(--zrm-field) inset !important; }
.zrm-field.zrm-invalid input, .zrm-field.zrm-invalid textarea, .zrm-field.zrm-invalid .er-cc-btn { border-color: var(--zrm-bad) !important; }
.zrm-phone { position: relative; display: flex; gap: 8px; margin-top: 6px; }
.zrm .zrm-phone > input { flex: 1 1 auto; min-width: 0; margin-top: 0; }

/* ── Selector de país con banderas (mismo marcado que el checkout) ── */
.zrm .er-cc { position: relative; flex: 0 0 150px; min-width: 0; max-width: 150px; }
.zrm .er-cc .er-cc-btn { min-width: 0; overflow: hidden; }
.zrm .er-cc-label { min-width: 0; }
.zrm .er-cc .er-cc-btn,
.zrm .er-cc .er-cc-btn:hover,
.zrm .er-cc .er-cc-btn:focus,
.zrm .er-cc .er-cc-btn:active {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--zrm-field-line) !important;
    border-radius: 10px !important;
    background: var(--zrm-field) !important;
    color: var(--zrm-ink) !important;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
}
.zrm .er-cc .er-cc-btn:hover,
.zrm .er-cc .er-cc-btn:focus-visible,
.zrm .er-cc .er-cc-btn[aria-expanded="true"] { border-color: var(--zrm-accent) !important; box-shadow: 0 0 0 3px rgba(255, 204, 0, .22) !important; outline: 0; }
.zrm .er-cc-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.zrm .er-cc-caret { opacity: .6; font-size: 12px; }
.zrm .er-cc-panel {
    position: absolute;
    z-index: 60;
    left: 0;
    top: calc(100% + 6px);
    width: min(88vw, 340px);
    padding: 8px;
    border: 1px solid var(--zrm-line);
    border-radius: 14px;
    background: var(--zrm-bg);
    color: var(--zrm-ink);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .25);
}
.zrm .er-cc-panel[hidden] { display: none; }
.zrm .er-cc-search {
    width: 100%;
    min-height: 44px;
    margin: 0 0 6px;
    padding: 8px 12px;
    border: 1px solid var(--zrm-field-line) !important;
    border-radius: 10px !important;
    background: var(--zrm-field) !important;
    color: var(--zrm-ink) !important;
    font: inherit;
    font-size: 15px;
    box-shadow: none !important;
    outline: 0;
}
.zrm .er-cc-list { max-height: 46vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; -webkit-overflow-scrolling: touch; }
.zrm .er-cc-list li { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; }
.zrm .er-cc-list li[hidden] { display: none; }
.zrm .er-cc-list li:hover, .zrm .er-cc-list li[aria-selected="true"] { background: rgba(255, 204, 0, .18); }
.zrm .er-cc-flag { width: 1.6em; font-size: 1.25em; text-align: center; }
.zrm .er-cc-name { flex: 1 1 auto; }
.zrm .er-cc-code { opacity: .7; white-space: nowrap; }
.zrm .er-cc-empty { margin: 8px; opacity: .75; }

/* ── Pago ── */
.zrm-error {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--zrm-bad);
    border-radius: 10px;
    background: rgba(220, 38, 38, .08);
    color: var(--zrm-bad);
    font-size: 14px;
    font-weight: 600;
}
.zrm-amount .zrm-error { margin-bottom: 14px; }
.zrm-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--zrm-accent);
    color: var(--zrm-accent-ink) !important;
    font: inherit;
    font-size: 16px;
    font-weight: 900;
    text-decoration: none !important;
    box-shadow: 0 10px 24px rgba(255, 204, 0, .22);
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
}
.zrm-submit:hover { filter: brightness(.96); }
.zrm-submit:active { transform: scale(.99); }
.zrm-submit[disabled] { opacity: .65; cursor: wait; }
.zrm-secure { margin: 10px 0 0; text-align: center; color: var(--zrm-muted); font-size: 13px; }

/* ── Remesa enviada ── */
.zrm-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--zrm-line);
    border-top: 4px solid var(--zrm-accent);
    border-radius: 18px;
    background: var(--zrm-bg);
    box-shadow: 0 14px 34px rgba(17, 24, 39, .06);
}
.zrm-done { text-align: center; }
.zrm-done .zrm-calc { margin: 20px 0 0; text-align: left; }
.zrm-done .zrm-submit { margin-top: 22px; }
.zrm-done-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 32px;
    font-weight: 900;
}

@media (max-width: 600px) {
    .zrm { margin: 16px auto 48px; padding: 0 12px; }
    .zrm-panel, .zrm-card { padding: 20px 16px; border-radius: 16px; }
    .zrm h1 { font-size: 24px; }
    .zrm .er-cc { flex-basis: 124px; max-width: 124px; }
}
