/* =============================================
   SPOF — Simple Product Order Form
   Public Stylesheet
   ============================================= */

:root {
    --spof-color:       #2563eb;
    --spof-color-light: #eff6ff;
    --spof-radius:      12px;
    --spof-shadow:      0 4px 24px rgba(0,0,0,.10);
    --spof-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Wrapper */
.spof-wrapper {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 24px;
    background: #fff;
    border-radius: var(--spof-radius);
    box-shadow: var(--spof-shadow);
    font-family: var(--spof-font);
    color: #1e293b;
}

.spof-theme-dark .spof-wrapper,
.spof-wrapper.spof-theme-dark {
    background: #1e293b;
    color: #e2e8f0;
}

/* Product header */
.spof-product-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}
.spof-product-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}
.spof-price-box { display: flex; align-items: center; justify-content: center; gap: 10px; }
.spof-price-main { font-size: 28px; font-weight: 800; color: var(--spof-color); }
.spof-price-original { font-size: 18px; color: #94a3b8; text-decoration: line-through; }

/* Fields */
.spof-field { margin-bottom: 18px; }
.spof-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.spof-req { color: #ef4444; }
.spof-opt { color: #94a3b8; font-weight: 400; font-size: 12px; }

.spof-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--spof-font);
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: inherit;
}
.spof-input:focus {
    outline: none;
    border-color: var(--spof-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.spof-textarea { resize: vertical; min-height: 70px; }
.spof-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Package grid */
.spof-pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.spof-pkg-card input { display: none; }
.spof-pkg-inner {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 14px 10px; border: 2px solid #e2e8f0; border-radius: 10px;
    cursor: pointer; text-align: center; transition: all .2s; gap: 4px;
    user-select: none;
}
.spof-pkg-card input:checked + .spof-pkg-inner {
    border-color: var(--spof-color);
    background: var(--spof-color-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.spof-pkg-name { font-weight: 700; font-size: 14px; }
.spof-pkg-price { font-size: 16px; font-weight: 800; color: var(--spof-color); }
.spof-pkg-original { font-size: 12px; color: #94a3b8; text-decoration: line-through; }

/* Qty control */
.spof-qty-control { display: flex; align-items: center; gap: 0; border: 1.5px solid #e2e8f0; border-radius: 8px; overflow: hidden; width: fit-content; }
.spof-qty-btn { background: #f8fafc; border: none; padding: 10px 18px; font-size: 20px; cursor: pointer; line-height: 1; }
.spof-qty-btn:hover { background: #e2e8f0; }
.spof-qty-input { width: 56px; border: none; border-left: 1.5px solid #e2e8f0; border-right: 1.5px solid #e2e8f0; text-align: center; font-size: 16px; font-weight: 700; padding: 10px 4px; }
.spof-qty-input:focus { outline: none; }

/* Payment options */
.spof-payment-options { display: flex; flex-direction: column; gap: 10px; }
.spof-pay-opt input { display: none; }
.spof-pay-label {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border: 2px solid #e2e8f0; border-radius: 10px;
    cursor: pointer; transition: all .2s;
}
.spof-pay-opt input:checked + .spof-pay-label {
    border-color: var(--spof-color);
    background: var(--spof-color-light);
}
.spof-pay-icon { font-size: 24px; }
.spof-pay-label strong { display: block; font-size: 15px; }
.spof-pay-label small { color: #64748b; font-size: 12px; }

/* Summary */
.spof-summary {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
}
.spof-summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.spof-summary-total { font-size: 17px; font-weight: 800; border-top: 1.5px solid #e2e8f0; margin-top: 8px; padding-top: 10px; }
.spof-summary-total span:last-child { color: var(--spof-color); }

/* Error */
.spof-error {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #dc2626;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 14px;
}

/* Submit button */
.spof-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--spof-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    font-family: var(--spof-font);
}
.spof-submit-btn:hover { opacity: .9; }
.spof-submit-btn:active { transform: scale(.98); }
.spof-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.spof-secure-note { text-align: center; color: #94a3b8; font-size: 12px; margin-top: 10px; }

/* Status pages */
.spof-status-wrap { max-width: 520px; margin: 0 auto; padding: 20px; }
.spof-status { text-align: center; padding: 40px 30px; border-radius: var(--spof-radius); box-shadow: var(--spof-shadow); }
.spof-status--success { background: #f0fdf4; border: 2px solid #86efac; }
.spof-status--failed  { background: #fef2f2; border: 2px solid #fca5a5; }
.spof-status-icon { font-size: 52px; margin-bottom: 16px; }
.spof-status h2 { font-size: 26px; margin: 0 0 10px; }
.spof-status-detail { background: #fff; border-radius: 10px; padding: 16px; margin: 20px 0; text-align: left; }
.spof-status-detail p { margin: 6px 0; font-size: 15px; }
.spof-btn-retry { display: inline-block; margin-top: 16px; padding: 12px 28px; background: var(--spof-color); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 700; }

@media (max-width: 540px) {
    .spof-wrapper { padding: 20px 16px; border-radius: 0; box-shadow: none; }
    .spof-pkg-grid { grid-template-columns: 1fr 1fr; }
}
