/*
 * Modals in views/parts/modalsNew.php (login / register, give / sponsor, card payment, DSD)
 * plus the ESPEES and bank-transfer modals it includes (parts/payment_detail_modals.php).
 *
 * Same look as the signup page (/signup) and the home page theme (index_theme.css):
 * Instrument Sans, navy ink, indigo primary, gold focus ring, red call-to-action.
 *
 * Linked from modalsNew.php itself, so every page that includes it gets the same modals.
 * Everything is scoped to .row-modal (and the two included modals by id) so the rest of
 * the page is not touched. style.css is unchanged; this file only overrides it.
 */

.row-modal,
#espees_details_modal,
#bankDatailsModal {
    --rm-font: "Instrument Sans", "Open Sans", Roboto, system-ui, sans-serif;
    --rm-ink: #14163b;
    --rm-text: #1e293b;
    --rm-muted: #64748b;
    --rm-primary: #2a2f8f;
    --rm-primary-hover: #22267a;
    --rm-accent: #3035b0;
    --rm-gold: #e8c547;
    --rm-red: rgb(222, 17, 53);
    --rm-red-hover: #c20e2e;
    --rm-soft: #eef0fb;
    --rm-line: #e2e8f0;
    --rm-surface: #fbfbfe;
    --rm-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Typography ---------- */
.row-modal,
.row-modal :not([class*="fa-"]):not(.btn-close),
#espees_details_modal :not([class*="fa-"]):not(.btn-close),
#bankDatailsModal :not([class*="fa-"]):not(.btn-close) {
    font-family: var(--rm-font);
}
.row-modal p { font-size: .9rem; line-height: 1.5; color: var(--rm-text); margin-bottom: .75rem; }
.row-modal h1, .row-modal h2, .row-modal h3, .row-modal h4, .row-modal h5 {
    color: var(--rm-ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ---------- Shell ---------- */
.row-modal .modal-dialog { max-width: 480px; }
.row-modal .modal-dialog.modal-lg { max-width: 640px; }
.row-modal .modal-content,
#espees_details_modal .modal-content,
#bankDatailsModal .modal-content {
    background: #fff;
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 24px 60px rgba(20, 22, 59, .28);
    overflow: hidden;
}
.row-modal .modal-header,
#espees_details_modal .modal-header,
#bankDatailsModal .modal-header {
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem .75rem;
    border-bottom: 0;
}
.row-modal .modal-body { padding: .5rem 1.5rem 1.5rem; }
.row-modal .modal-footer,
#espees_details_modal .modal-footer,
#bankDatailsModal .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #eef0f4;
}
.row-modal .modal-footer > * { margin: 0; }
.row-modal .btn-close { flex: none; margin: 0 0 0 auto; padding: .6rem; border-radius: 50%; opacity: .6; }
.row-modal .btn-close:hover { opacity: 1; background-color: var(--rm-soft); }
.row-modal .btn-close:focus { box-shadow: 0 0 0 3px rgba(232, 197, 71, .6); }

/* Header text: eyebrow + title (like the signup card) */
.row-modal-eyebrow {
    display: flex; align-items: center; gap: .6rem; margin: 0 0 .3rem;
    font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--rm-accent);
}
.row-modal-eyebrow::before { content: ""; width: 1.25rem; height: 2px; background: var(--rm-gold); }
.row-modal .modal-title,
#espees_details_modal .modal-title,
#bankDatailsModal .modal-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; color: var(--rm-ink); margin: 0; }
.row-modal-sub { font-size: .875rem; color: var(--rm-muted); margin: .35rem 0 0; }
.row-modal-logo { width: 3.25rem; height: 3.25rem; border-radius: 50%; flex: none; }

/* ---------- Forms ---------- */
.row-modal .form-label { font-size: .875rem; font-weight: 500; color: var(--rm-text); margin-bottom: .4rem; }
.row-modal .form-control,
.row-modal .form-select {
    min-height: 2.875rem;
    padding: .6rem .85rem;
    font-size: .9rem;
    color: var(--rm-ink);
    background-color: #fff;
    border: 1px solid #d2d6da;
    border-radius: .75rem;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.row-modal .form-control::placeholder { color: #94a3b8; }
.row-modal .form-control:focus,
.row-modal .form-select:focus {
    border-color: var(--rm-primary);
    box-shadow: 0 0 0 3px rgba(42, 47, 143, .15);
}
.row-modal .form-control[readonly] { background: #f8fafc; color: #334155; }
.row-modal .form-select { text-transform: capitalize; }
.row-modal .form-text { font-size: .75rem; color: var(--rm-muted); }

/* ---------- Buttons ---------- */
.row-modal .btn,
#espees_details_modal .btn,
#bankDatailsModal .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 2.875rem; padding: .65rem 1.1rem;
    font-size: .9rem; font-weight: 600; letter-spacing: 0; text-transform: none;
    border-radius: .75rem;
    transition: background-color .2s ease, border-color .2s ease, transform .2s var(--rm-ease), box-shadow .2s ease;
}
.row-modal .btn:focus-visible { outline: 2px solid var(--rm-gold); outline-offset: 2px; box-shadow: none; }
.row-modal .btn.w-100 { display: flex; }
.row-modal .btn.d-none { display: none !important; }

.row-modal .row-btn-red {
    background: var(--rm-red); border: 1px solid var(--rm-red); color: #fff;
    box-shadow: 0 8px 18px rgba(222, 17, 53, .22);
}
.row-modal .row-btn-red:hover { background: var(--rm-red-hover); border-color: var(--rm-red-hover); color: #fff; transform: translateY(-1px); }

.row-modal .row-btn-primary {
    background: var(--rm-primary); border: 1px solid var(--rm-primary); color: #fff;
    box-shadow: 0 8px 18px rgba(20, 22, 59, .2);
}
.row-modal .row-btn-primary:hover { background: var(--rm-primary-hover); border-color: var(--rm-primary-hover); color: #fff; transform: translateY(-1px); }

.row-modal .row-btn-dark { background: var(--rm-ink); border: 1px solid var(--rm-ink); color: #fff; }
.row-modal .row-btn-dark:hover { background: #0b0c24; color: #fff; }

.row-modal .row-btn-outline { background: #fff; border: 1px solid #d2d6da; color: var(--rm-ink); }
.row-modal .row-btn-outline:hover { border-color: var(--rm-primary); color: var(--rm-primary); background: #fff; }

.row-modal .row-btn-momo { background: #ffcb05; border: 1px solid #ffcb05; color: #14163b; }
.row-modal .row-btn-momo:hover { background: #f0bd00; color: #14163b; }

/* KingsChat: same blue button as "Sign up with KingsChat" on /signup */
.row-modal .row-btn-kc {
    background: #00a9f4; border: 0; color: #fff;
    box-shadow: 0 6px 16px rgba(0, 169, 244, .28);
}
.row-modal .row-btn-kc img { width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.row-modal .row-btn-kc:hover { background: #0096d9; color: #fff; transform: translateY(-1px); }

/* "or" divider */
.row-modal-or { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--rm-muted); font-size: .8rem; }
.row-modal-or::before, .row-modal-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--rm-line); }

/* ---------- Email / phone switch (segmented control, as on /signup) ---------- */
.row-modal .row-seg { display: flex; padding: 3px; margin-bottom: 1rem; border-radius: 999px; background: #eef0f6; }
.row-modal .row-seg .nav-item { flex: 1; }
.row-modal .row-seg .nav-link {
    width: 100%; padding: .45rem .75rem; border: 0; border-radius: 999px;
    background: transparent; color: #475569; font-size: .85rem; font-weight: 600;
}
.row-modal .row-seg .nav-link.active { background: #fff; color: var(--rm-ink); box-shadow: 0 1px 3px rgba(20, 22, 59, .15); }

/* ---------- Give / sponsor: amount chips ---------- */
.row-modal #donation-options .donation-option {
    display: flex; align-items: center; gap: .75rem; width: 100%; margin: 0;
    padding: .75rem .9rem;
    background: #fff;
    border: 1px solid var(--rm-line);
    border-radius: .85rem;
    box-shadow: none;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.row-modal #donation-options .donation-option:hover { border-color: #b8bde6; background: var(--rm-surface); }
.row-modal #donation-options .donation-option.active {
    border-color: var(--rm-primary);
    background: var(--rm-soft);
    box-shadow: 0 0 0 1px var(--rm-primary) inset;
}
.row-modal #donation-options .donation-option span { font-size: .9rem; font-weight: 700; color: var(--rm-ink); }
.row-modal #donation-options .circle { margin: 0; width: 1.15rem; height: 1.15rem; border: 2px solid #c3c8d4; }
.row-modal #donation-options .donation-option.active .circle { border: 5px solid var(--rm-red); }
.row-modal #donation-options .optional_input input[type="text"] {
    flex: 1; min-width: 0; padding: 0; border: 0; background: transparent;
    font-size: .9rem; font-weight: 600; color: var(--rm-ink); outline: none;
}
.row-modal #donation-options .optional_input input[type="text"]::placeholder { font-weight: 500; color: #94a3b8; }

/* Running total */
.row-modal-total {
    display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
    margin: 1rem 0; padding: .75rem .9rem;
    border: 1px dashed #dbe1ea; border-radius: .85rem; background: var(--rm-surface);
}
.row-modal-total-label { font-size: .8rem; color: var(--rm-muted); }
.row-modal-total strong { font-size: 1.25rem; color: var(--rm-ink); letter-spacing: -0.01em; }
.row-modal .row-modal-note { display: block; font-size: .7rem; color: var(--rm-muted); text-align: center; margin: -.25rem 0 .5rem; }

/* Section label ("Pay with") */
.row-modal-section {
    display: block; margin: 1.25rem 0 .6rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--rm-muted);
}

/* Messages written by the payment scripts */
.row-modal #payment-failed:not(:empty),
.row-modal #payment-pending:not(:empty),
.row-modal #payment-success:not(:empty),
.row-modal #reg_response_id:not(:empty) { display: block; margin: .5rem 0; font-size: .85rem; }

/* ---------- Card payment (Stripe) ---------- */
.row-modal .row-pay-cards { width: 9rem; height: auto; }
.row-modal #card-element { min-height: 2.875rem; padding-top: .8rem; }
.row-modal #card-errors:not(:empty) { margin-top: .5rem; font-size: .8rem; color: #b91c1c; }

/* ---------- DSD banner ---------- */
.row-modal .row-modal-banner { display: block; width: 100%; height: auto; }
.row-modal .row-modal-floating-close {
    position: absolute; top: .75rem; right: .75rem; z-index: 2;
    background-color: rgba(255, 255, 255, .9);
}

/* ---------- Spinner (was .loader, white on white in these modals) ---------- */
.row-modal .loader {
    width: 2.5rem; height: 2.5rem;
    border: 4px solid var(--rm-soft);
    border-bottom-color: var(--rm-red);
    border-radius: 50%;
    display: inline-block;
    animation: row-modal-spin 1s linear infinite;
}
.row-modal .loader.d-none { display: none !important; }
@keyframes row-modal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .row-modal .loader { animation-duration: 2.5s; } }

/* ---------- Phones: bottom sheet feel, full-width buttons ---------- */
@media (max-width: 575.98px) {
    .row-modal .modal-dialog { margin: .75rem; }
    .row-modal .modal-header { padding: 1.1rem 1.1rem .6rem; }
    .row-modal .modal-body { padding: .5rem 1.1rem 1.25rem; }
    .row-modal .modal-footer { padding: .9rem 1.1rem 1.1rem; }
    /* responsive.css forces h2 to 60px, h3 to 25px and p to 16px (!important) on phones */
    .row-modal .modal-title { font-size: 1.25rem !important; line-height: 1.2 !important; }
    .row-modal h3 { font-size: 1.1rem !important; }
    .row-modal p { font-size: .875rem !important; }
    .row-modal .row-modal-eyebrow { font-size: .7rem !important; justify-content: flex-start; text-align: left; }
    .row-modal .row-modal-sub { font-size: .8rem !important; }
    .row-modal .row-modal-logo { width: 2.75rem; height: 2.75rem; }
}
