/* ============================================================
   ED Confirm — Front-end styles
   ============================================================ */

.edc-wrap {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Messages */
.edc-msg {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 15px;
}
.edc-msg--success { color: #fff; }
.edc-msg--error   { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6cb; }

/* Form card */
.edc-form {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 2px 20px rgba(0,0,0,.06);
    box-sizing: border-box;
}

/* ── Layout: desktop two-column, mobile single-column ── */
/* Each .edc-row is a flex container on desktop */
.edc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Single-column rows */
.edc-row.edc-row--full {
    grid-template-columns: 1fr;
}

/* Fields */
.edc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.edc-field--full {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    min-width: 0;
}

.edc-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}
.edc-req { color: #e74c3c; margin-left: 2px; }

/* Inputs */
.edc-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dde1e7;
    border-radius: 9px;
    font-size: 15px;
    color: #222;
    background: #fafbfc;
    transition: border-color .18s, box-shadow .18s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.edc-input:focus {
    border-color: #1a1a2e;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,26,46,.08);
}
.edc-input--error { border-color: #e74c3c !important; }
.edc-textarea { resize: vertical; min-height: 72px; }

/* ── Bank Cards ────────────────────────────────────────────── */
.edc-banks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.edc-bank-card {
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    background: #fafbfc;
    transition: border-color .18s, background .18s;
    box-sizing: border-box;
    cursor: pointer;
    padding: 12px 12px 12px 36px;
}
.edc-bank-card:hover { border-color: #b0b8c8; }
.edc-bank-card--selected {
    border-color: #1a1a2e;
    background: #f0f2f7;
}
.edc-bank-radio {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    accent-color: #1a1a2e;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.edc-bank-label {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 0;
    gap: 14px;
    cursor: pointer;
    box-sizing: border-box;
}
.edc-bank-logo { flex-shrink: 0; }
.edc-bank-logo img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e8e8e8;
    background: #fff;
    display: block;
}
.edc-bank-table {
    margin: 0;
    line-height: 1.6;
    border: none;
    border-collapse: collapse;
}
.edc-bank-table th {
    font-weight: normal;
    font-size: 13px;
    color: #888;
    padding: 2px 14px 2px 0;
    border: none;
    white-space: nowrap;
    vertical-align: middle;
}
.edc-bank-table td {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    padding: 2px 0;
    border: none;
    vertical-align: middle;
}
@media (min-width: 600px) {
    .edc-bank-card { padding: 14px 16px 14px 42px; }
    .edc-bank-radio { left: 14px; width: 18px; height: 18px; }
}
.edc-bank-label-inline { font-size: 12px; color: #888; font-weight: 400; }
.edc-bank-number {
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.edc-bank-number strong { font-weight: 700; }
.edc-bank-holder, .edc-bank-branch { font-size: 12px; color: #666; margin-top: 2px; }
.edc-copy { cursor: pointer; }
.edc-copy-icon {
    cursor: pointer;
    font-size: 14px;
    opacity: .55;
    transition: opacity .15s;
    user-select: none;
    -webkit-user-select: none;
}
.edc-copy-icon:hover { opacity: 1; }

/* ── Slip Upload ──────────────────────────────────────────── */
.edc-slip-wrap { position: relative; }
.edc-slip-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 16px;
    border: 2px dashed #cdd3dd;
    border-radius: 12px;
    cursor: pointer;
    background: #f8f9fb;
    transition: border-color .18s;
    text-align: center;
    box-sizing: border-box;
}
.edc-slip-label:hover { border-color: #1a1a2e; background: #f0f2f7; }
.edc-slip-icon { font-size: 28px; }
.edc-slip-text { font-size: 14px; font-weight: 600; color: #444; }
.edc-slip-hint { font-size: 12px; color: #999; }
.edc-slip-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.edc-slip-preview { margin-top: 12px; position: relative; display: inline-block; }
.edc-slip-preview img {
    max-width: 180px;
    max-height: 180px;
    border-radius: 10px;
    border: 1px solid #dde1e7;
    display: block;
}
.edc-slip-remove {
    position: absolute;
    top: -8px; right: -8px;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: none;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ── Time ────────────────────────────────────────────────── */
.edc-time-row { display: flex; align-items: center; gap: 6px; }
.edc-time-select { flex: 1; }
.edc-time-sep { font-weight: 700; font-size: 18px; color: #888; flex-shrink: 0; }

/* ── Submit ──────────────────────────────────────────────── */
.edc-submit-row { margin-top: 24px; }
.edc-btn--submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 32px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.edc-btn--submit:hover { background: #2d2d50; transform: translateY(-1px); }
.edc-btn--submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.edc-btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: edc-spin .6s linear infinite;
}
@keyframes edc-spin { to { transform: rotate(360deg); } }

.edc-detail {
    background: #f4f6f9;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #555;
    white-space: pre-wrap;
    margin-bottom: 16px;
    border: 1px solid #e4e8ef;
}

/* ── Mobile: single column, no flex-basis height issues ── */
@media (max-width: 600px) {
    .edc-form {
        padding: 20px 16px;
        border-radius: 12px;
    }

    /* Convert grid to single column — no flex-basis involved */
    .edc-row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .edc-btn--submit { width: 100%; justify-content: center; }
}

@media (max-width: 360px) {
    .edc-bank-number { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ── New flat grid layout ─────────────────────────────────── */
/* edc-grid: 2 columns on desktop, 1 column on mobile */
.edc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
/* edc-f: a single field cell */
.edc-f {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
/* edc-f--full: span both columns */
.edc-f--full {
    grid-column: 1 / -1;
}
/* edc-section: full-width block (banks, slip, remark) */
.edc-section {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 600px) {
    .edc-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }
    .edc-f--full { grid-column: 1; }
    .edc-section { margin-bottom: 12px; }
}


/* Account number turns green with a ✓ checkmark simultaneously on card select */
.edc-bank-number .edc-copy { transition: color .2s; }
.edc-number--copied .edc-copy {
    color: #27ae60 !important;
    font-weight: 700;
}
.edc-number--copied .edc-copy::after {
    content: ' ✓';
    color: #27ae60;
    font-weight: 700;
}
.edc-number--copied .edc-copy-icon { display: none; }

/* ── Green ✓ on account number when card is selected ──────── */
.edc-bank-card--green .edc-bank-number .edc-copy {
    color: #27ae60;
    font-weight: 700;
}
.edc-bank-card--green .edc-bank-number .edc-copy::after {
    content: ' ✓';
    color: #27ae60;
}
.edc-bank-card--green .edc-copy-icon {
    display: none;
}

/* Account No. inline label */
.edc-bank-label-inline {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* ── PromptPay QR display ────────────────────────────────── */
.edc-qr-wrap {
    margin-bottom: 16px;
}
.edc-qr-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: #fff;
    border: 2px solid #1a1a2e;
    border-radius: 12px;
}
.edc-qr-img {
    width: 150px;
    height: 150px;
    display: block;
    flex-shrink: 0;
}
.edc-qr-detail { flex: 1; }
.edc-qr-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a1a2e;
}
.edc-qr-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin: 0;
}
@media (max-width: 480px) {
    .edc-qr-inner { flex-direction: column; align-items: center; text-align: center; }
    .edc-qr-img { width: 180px; height: 180px; }
}
