/* ============================================================
   Cloud Elite – Voucher Form  (front.css)
   ============================================================ */

/* ---------- Reset & Container ---------- */
.ce-voucher-wrap {
    --ce-gold: #d6b56d;
    --ce-gold-hover: #b89b53;
    --ce-dark: #1a1a2e;
    --ce-text: #333;
    --ce-muted: #777;
    --ce-bg: #f8f8fb;
    --ce-card: #fff;
    --ce-border: #e2e2e9;
    --ce-radius: 12px;
    --ce-shadow: 0 4px 24px rgba(0,0,0,.08);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    color: var(--ce-text);
}
.ce-voucher-wrap *, .ce-voucher-wrap *:before, .ce-voucher-wrap *:after {
    box-sizing: border-box;
}

/* ---------- Card ---------- */
.ce-voucher-card {
    background: var(--ce-card);
    border-radius: var(--ce-radius);
    box-shadow: var(--ce-shadow);
    overflow: hidden;
}

/* ---------- Header ---------- */
.ce-voucher-header {
    background: linear-gradient(135deg, var(--ce-dark) 0%, #16213e 100%);
    color: #fff;
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}
.ce-voucher-icon {
    width: 48px;
    height: 48px;
    color: var(--ce-gold);
    margin-bottom: .75rem;
}
.ce-voucher-title {
    margin: 0 0 .5rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}
.ce-voucher-subtitle {
    margin: 0;
    font-size: .95rem;
    opacity: .8;
}

/* ---------- Body / Steps ---------- */
.ce-voucher-body {
    padding: 1.5rem 2rem 2rem;
}
.ce-step {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ce-border);
}
.ce-step:last-of-type {
    border-bottom: none;
    margin-bottom: .5rem;
    padding-bottom: .5rem;
}
.ce-step-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--ce-text);
}
.ce-step-label small {
    font-weight: 400;
    color: var(--ce-muted);
    font-size: .85rem;
}
.ce-step-hint {
    font-style: italic;
    font-size: .85rem;
    color: var(--ce-muted);
    margin: -.5rem 0 1rem;
}
.ce-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--ce-gold);
    color: #fff;
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------- Products (card + qty per product) ---------- */
.ce-products {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.ce-product {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    border: 2px solid var(--ce-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: border-color .2s, box-shadow .2s;
}
.ce-product.selected {
    border-color: var(--ce-gold);
    box-shadow: 0 0 0 3px rgba(214, 181, 109, .2);
}
.ce-product-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 1rem;
    flex: 1;
    min-width: 0;
}
.ce-product-name {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.05rem;
}
.ce-product-desc {
    grid-column: 1;
    grid-row: 2;
    font-size: .85rem;
    color: var(--ce-muted);
    margin-top: .15rem;
}
.ce-product-price {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ce-gold-hover);
    white-space: nowrap;
}
.ce-product-qty {
    flex-shrink: 0;
}

/* ---------- Quantity (inline per product) ---------- */
.ce-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ce-border);
    border-radius: 8px;
    overflow: hidden;
}
.ce-qty-btn {
    background: var(--ce-bg);
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ce-text);
}
.ce-qty-btn:hover {
    background: var(--ce-border);
}
.ce-item-qty {
    width: 42px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--ce-border);
    border-right: 1px solid var(--ce-border);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}
.ce-item-qty::-webkit-inner-spin-button,
.ce-item-qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- Summary ---------- */
.ce-sum-empty {
    color: var(--ce-muted);
    font-style: italic;
}

/* ---------- Fields ---------- */
.ce-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.ce-field-group--single {
    grid-template-columns: 1fr;
    margin-top: .75rem;
}
.ce-field-group--single .ce-field input {
    max-width: 280px;
}
.ce-field label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: .3rem;
}
.ce-req {
    color: #e74c3c;
}
.ce-field input {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--ce-border);
    border-radius: 8px;
    font-size: .95rem;
    transition: border-color .2s;
}
.ce-field input:focus {
    outline: none;
    border-color: var(--ce-gold);
    box-shadow: 0 0 0 3px rgba(214, 181, 109, .15);
}
.ce-field input.ce-invalid {
    border-color: #e74c3c;
}

/* ---------- Summary ---------- */
.ce-summary {
    background: var(--ce-bg);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.ce-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    margin-bottom: .35rem;
}
.ce-sum-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: .6rem;
    margin-top: .4rem;
    border-top: 1px solid var(--ce-border);
}
.ce-sum-total strong {
    color: var(--ce-gold-hover);
}

/* ---------- Error ---------- */
.ce-error {
    background: #fef0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}

/* ---------- Pay button ---------- */
.ce-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .9rem;
    background: var(--ce-gold);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.ce-pay-btn:hover {
    background: var(--ce-gold-hover);
    transform: translateY(-1px);
}
.ce-pay-btn:active {
    transform: translateY(0);
}
.ce-pay-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}
.ce-btn-icon {
    width: 22px;
    height: 22px;
}
.ce-pay-btn .ce-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ce-spin .6s linear infinite;
}
@keyframes ce-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Secure note ---------- */
.ce-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: .75rem 0 0;
    font-size: .8rem;
    color: var(--ce-muted);
}

/* ---------- Confirmation ---------- */
.ce-confirmation {
    text-align: center;
    padding: 2.5rem 2rem;
}
.ce-conf-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.ce-conf-success {
    color: #27ae60;
}
.ce-conf-pending {
    color: var(--ce-gold);
}
.ce-confirmation h2 {
    margin: 0 0 .5rem;
    font-size: 1.4rem;
    color: var(--ce-text);
}
.ce-confirmation p {
    margin: 0 0 1.5rem;
    color: var(--ce-muted);
}
.ce-conf-details {
    margin: 0 auto 1rem;
    border-collapse: collapse;
    text-align: left;
    font-size: .95rem;
}
.ce-conf-details td {
    padding: .35rem .75rem;
    border-bottom: 1px solid var(--ce-border);
}
.ce-conf-details td:first-child {
    color: var(--ce-muted);
    font-weight: 500;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
    .ce-voucher-wrap {
        padding: 0 .5rem;
        margin: 1rem auto;
    }
    .ce-voucher-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    .ce-voucher-title {
        font-size: 1.25rem;
    }
    .ce-voucher-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }
    .ce-field-group {
        grid-template-columns: 1fr;
    }
    .ce-product-inner {
        grid-template-columns: 1fr;
        gap: .25rem;
    }
    .ce-product {
        flex-wrap: wrap;
    }
    .ce-product-inner {
        flex: 1 1 100%;
    }
    .ce-product-qty {
        margin-left: auto;
    }
    .ce-product-price {
        grid-column: 1;
        grid-row: auto;
        font-size: 1.05rem;
    }
}

@media (max-width: 400px) {
    .ce-voucher-header {
        padding: 1.25rem 1rem;
    }
    .ce-voucher-body {
        padding: 1rem;
    }
    .ce-pay-btn {
        font-size: 1rem;
        padding: .8rem;
    }
}
