/* ==================================================================
   buycopy-v2.css — ฟอร์มขอสำเนารายงาน
   ================================================================== */

:root {
    --bc-primary: #5b5fd6;
    --bc-primary-dark: #43479f;
    --bc-line: #06c755;
    --bc-line-dark: #05a648;
    --bc-ink: #22242e;
    --bc-muted: #6b6f80;
    --bc-border: #e3e5ee;
    --bc-bg: #f4f5f9;
    --bc-danger: #d64545;
    --bc-ok: #1f9d63;
    --bc-header-h: 94px;
}

.bc-page {
    font-family: 'Prompt', sans-serif;
    background: var(--bc-bg);
    color: var(--bc-ink);
    padding-top: var(--bc-header-h);   /* .header ใน style.css เป็น position:fixed */
    margin: 0;
}

.bc-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 20px 60px;
}

.bc-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--bc-muted);
    text-decoration: none;
    font-size: .9em;
    margin-bottom: 18px;
}

.bc-back:hover {
    color: var(--bc-primary);
}

.bc-head {
    margin-bottom: 26px;
}

.bc-head h1 {
    font-size: 1.95em;
    font-weight: 600;
    margin: 0 0 8px;
}

.bc-head p {
    margin: 0;
    color: var(--bc-muted);
    font-size: 1em;
    line-height: 1.75;
    max-width: 62ch;
}

/* ------------------------------------------------------------------
   2 ช่องทางติดต่อ
   ------------------------------------------------------------------ */
.bc-channels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.bc-channel {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    padding: 22px;
}

.bc-channel-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #fff;
}

.bc-channel-line .bc-channel-icon {
    background: var(--bc-line);
}

.bc-channel-form .bc-channel-icon {
    background: var(--bc-primary);
}

.bc-channel-line {
    border-color: #b8ecc9;
    background: #f5fdf8;
}

.bc-channel-body {
    min-width: 0;
}

.bc-channel h2 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 6px;
}

.bc-channel p {
    margin: 0 0 14px;
    color: var(--bc-muted);
    font-size: .92em;
    line-height: 1.75;
}

.bc-line-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.bc-btn-qr {
    background: #fff;
}

.bc-line-id {
    margin: 11px 0 0 !important;
    font-size: .88em !important;
    color: var(--bc-muted) !important;
}

.bc-channel-alt {
    display: block;
    margin-top: 10px;
    font-size: .88em;
    color: var(--bc-muted);
}

/* ------------------------------------------------------------------
   ปุ่ม
   ------------------------------------------------------------------ */
.bc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: .95em;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

.bc-btn-primary {
    background: var(--bc-primary);
    color: #fff;
}

.bc-btn-primary:hover {
    background: var(--bc-primary-dark);
}

.bc-btn-line {
    background: var(--bc-line);
    color: #fff;
}

.bc-btn-line:hover {
    background: var(--bc-line-dark);
}

.bc-btn-ghost {
    background: #fff;
    border-color: var(--bc-border);
    color: var(--bc-muted);
}

.bc-btn-ghost:hover {
    border-color: var(--bc-primary);
    color: var(--bc-primary);
}

.bc-btn-lg {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.05em;
    font-weight: 600;
}

.bc-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

/* สถานะกำลังส่ง */
.bc-btn.is-loading {
    position: relative;
    color: transparent;
}

.bc-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bc-spin .8s linear infinite;
}

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

/* ------------------------------------------------------------------
   โครง 2 คอลัมน์
   ------------------------------------------------------------------ */
.bc-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.bc-card {
    background: #fff;
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    padding: 26px;
}

/* ------------------------------------------------------------------
   ขั้นตอนในฟอร์ม
   ------------------------------------------------------------------ */
.bc-step + .bc-step {
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid var(--bc-border);
}

.bc-step-title {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 1.08em;
    font-weight: 600;
    margin: 0 0 16px;
}

.bc-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bc-primary);
    color: #fff;
    font-size: .82em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------
   รายงานที่เลือกไว้
   ------------------------------------------------------------------ */
.bc-selected:empty {
    display: none;
}

.bc-selected {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 14px;
}

.bc-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0f1fe;
    border: 1px solid #cdd0f5;
    border-radius: 10px;
    padding: 12px 14px;
}

.bc-chip-main {
    flex: 1;
    min-width: 0;
}

.bc-chip-title {
    font-weight: 600;
    font-size: .95em;
    line-height: 1.45;
}

.bc-chip-sub {
    display: block;
    color: var(--bc-muted);
    font-size: .85em;
    margin-top: 2px;
}

.bc-chip-price {
    font-weight: 600;
    white-space: nowrap;
    font-size: .95em;
}

.bc-chip-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #dfe1fa;
    color: var(--bc-primary-dark);
    cursor: pointer;
    font-size: 1.05em;
    line-height: 1;
}

.bc-chip-remove:hover {
    background: var(--bc-primary);
    color: #fff;
}

.bc-empty-hint {
    margin: 0 0 14px;
    padding: 14px 16px;
    background: #fafbff;
    border: 1px dashed var(--bc-border);
    border-radius: 10px;
    color: var(--bc-muted);
    font-size: .9em;
}

.bc-empty-hint[hidden] {
    display: none;
}

/* ------------------------------------------------------------------
   ตัวเลือกรายงาน
   ------------------------------------------------------------------ */
.bc-picker {
    border: 1px solid var(--bc-border);
    border-radius: 10px;
    overflow: hidden;
}

.bc-picker-search {
    position: relative;
    border-bottom: 1px solid var(--bc-border);
}

.bc-picker-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bc-muted);
    pointer-events: none;
}

.bc-picker-search input {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    padding: 14px 16px 14px 42px;
    font-family: inherit;
    font-size: .95em;
    background: #fafbff;
}

.bc-picker-search input:focus {
    outline: none;
    background: #fff;
}

.bc-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 290px;
    overflow-y: auto;
}

.bc-picker-list li {
    border-bottom: 1px solid #f2f3f8;
}

.bc-picker-list li:last-child {
    border-bottom: 0;
}

.bc-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 12px 16px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.bc-opt:hover {
    background: #f5f6ff;
}

.bc-opt[disabled] {
    opacity: .45;
    cursor: default;
}

.bc-opt-main {
    flex: 1;
    min-width: 0;
}

.bc-opt-title {
    font-size: .93em;
    font-weight: 500;
    line-height: 1.4;
}

.bc-opt-sub {
    display: block;
    color: var(--bc-muted);
    font-size: .84em;
    margin-top: 2px;
}

.bc-opt-year {
    font-size: .78em;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.bc-opt-year[data-year="2025"] { background: #e2f4ed; color: #1f7a5a; }
.bc-opt-year[data-year="2024"] { background: #fbeee0; color: #b06a2c; }

.bc-opt-price {
    font-size: .88em;
    color: var(--bc-muted);
    white-space: nowrap;
    min-width: 62px;
    text-align: right;
}

.bc-opt-add {
    color: var(--bc-primary);
    font-size: .95em;
}

.bc-picker-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--bc-muted);
    font-size: .9em;
}

/* ------------------------------------------------------------------
   ช่องกรอกข้อมูล
   ------------------------------------------------------------------ */
.bc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.bc-field-full {
    grid-column: 1 / -1;
}

.bc-field label {
    display: block;
    font-size: .9em;
    font-weight: 500;
    margin-bottom: 6px;
}

.bc-req {
    color: var(--bc-danger);
}

.bc-optional {
    color: var(--bc-muted);
    font-weight: 400;
    font-size: .9em;
}

.bc-field input,
.bc-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--bc-border);
    border-radius: 9px;
    font-family: inherit;
    font-size: .95em;
    background: #fff;
    color: var(--bc-ink);
}

.bc-field textarea {
    resize: vertical;
    line-height: 1.7;
}

.bc-field input:focus,
.bc-field textarea:focus {
    outline: none;
    border-color: var(--bc-primary);
    box-shadow: 0 0 0 3px rgba(91, 95, 214, .15);
}

.bc-field.is-invalid input,
.bc-field.is-invalid textarea {
    border-color: var(--bc-danger);
    background: #fff8f8;
}

.bc-field-hint {
    margin: 6px 0 0;
    font-size: .84em;
    color: var(--bc-muted);
}

.bc-field-error {
    margin: 6px 0 0;
    font-size: .85em;
    color: var(--bc-danger);
    min-height: 0;
}

.bc-field-error:empty {
    display: none;
}

/* ตัวเลือกช่องทางติดต่อกลับ */
.bc-radio-group {
    margin: 20px 0 0;
    padding: 0;
    border: 0;
}

.bc-radio-group legend {
    padding: 0;
    font-size: .9em;
    font-weight: 500;
    margin-bottom: 9px;
}

.bc-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    padding: 9px 16px;
    border: 1px solid var(--bc-border);
    border-radius: 9px;
    cursor: pointer;
    font-size: .92em;
    background: #fff;
}

.bc-radio:has(input:checked) {
    border-color: var(--bc-primary);
    background: #f0f1fe;
    color: var(--bc-primary-dark);
    font-weight: 500;
}

/* honeypot กันบอท */
.bc-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ------------------------------------------------------------------
   สรุปยอด + ปุ่มส่ง
   ------------------------------------------------------------------ */
.bc-summary {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--bc-border);
}

.bc-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 6px;
}

.bc-summary-line span {
    color: var(--bc-muted);
    font-size: .95em;
}

.bc-summary-line strong {
    font-size: 1.55em;
    font-weight: 700;
}

.bc-summary-note {
    margin: 0 0 16px;
    font-size: .86em;
    color: var(--bc-muted);
    line-height: 1.7;
}

.bc-form-error {
    margin: 12px 0 0;
    padding: 12px 14px;
    background: #fdf2f2;
    border: 1px solid #f3cccc;
    border-radius: 9px;
    color: #a33;
    font-size: .9em;
    line-height: 1.7;
}

.bc-form-error:empty {
    display: none;
}

/* ------------------------------------------------------------------
   แถบข้าง
   ------------------------------------------------------------------ */
.bc-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: calc(var(--bc-header-h) + 16px);
}

.bc-side-card {
    padding: 20px 22px;
}

.bc-side-card h3 {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 13px;
}

.bc-check {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bc-check li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 9px;
    font-size: .9em;
    line-height: 1.65;
    color: #4a4d5c;
}

.bc-check li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    color: var(--bc-ok);
    font-size: .82em;
}

.bc-steps {
    margin: 0;
    padding-left: 19px;
    font-size: .9em;
    line-height: 1.9;
    color: #4a4d5c;
}

.bc-side-note {
    margin: 14px 0 0;
    font-size: .88em;
}

.bc-side-note a,
.bc-side-contact a {
    color: var(--bc-primary-dark);
}

.bc-side-contact p {
    margin: 0 0 10px;
    font-size: .9em;
    color: #4a4d5c;
}

.bc-side-contact i {
    width: 18px;
    color: var(--bc-muted);
    margin-right: 5px;
}

/* ------------------------------------------------------------------
   Modal
   ------------------------------------------------------------------ */
.bc-modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 40, .55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bc-modal[hidden] {
    display: none;
}

.bc-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 34px 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    animation: bc-pop .22s ease-out;
}

@keyframes bc-pop {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bc-modal-box h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 10px;
}

.bc-modal-box p {
    margin: 0 0 6px;
    color: var(--bc-muted);
    font-size: .95em;
    line-height: 1.8;
}

.bc-modal-x {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 1.6em;
    line-height: 1;
    color: var(--bc-muted);
    cursor: pointer;
}

.bc-result-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--bc-ok);
    color: #fff;
    font-size: 1.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.bc-modal.is-error .bc-result-icon {
    background: var(--bc-danger);
}

.bc-result-ref {
    margin-top: 10px !important;
    font-size: .88em !important;
    color: var(--bc-ink) !important;
}

.bc-result-ref:empty {
    display: none;
}

.bc-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
    flex-wrap: wrap;
}

.bc-modal-qr img {
    max-width: 240px;
    height: auto;
    border-radius: 10px;
    margin: 6px 0 14px;
}

/* ------------------------------------------------------------------
   จอเล็ก
   ------------------------------------------------------------------ */
@media (max-width: 980px) {
    .bc-main {
        grid-template-columns: 1fr;
    }

    .bc-side {
        position: static;
    }
}

@media (max-width: 700px) {
    :root {
        --bc-header-h: 76px;
    }

    .bc-channels {
        grid-template-columns: 1fr;
    }

    .bc-grid {
        grid-template-columns: 1fr;
    }

    .bc-card {
        padding: 20px 17px;
    }

    .bc-head h1 {
        font-size: 1.5em;
    }

    .bc-chip {
        flex-wrap: wrap;
    }

    .bc-chip-price {
        margin-left: auto;
    }

    /* ปุ่มส่งลอยติดล่างจอ กดง่ายไม่ต้องเลื่อนหา */
    .bc-summary {
        position: sticky;
        bottom: 0;
        background: #fff;
        margin: 30px -17px -20px;
        padding: 16px 17px 18px;
        border-top: 1px solid var(--bc-border);
        box-shadow: 0 -6px 18px rgba(30, 32, 60, .08);
    }

    .bc-summary-note {
        display: none;
    }
}
