/* =========================================================
   Exam Paper Order Form — form.css
   ========================================================= */

.epof-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Sections ── */
.epof-section {
    margin-bottom: 2.5rem;
}

.epof-section__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e2e2e2;
}

.epof-section__desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 1rem;
}

/* ── Grid ── */
.epof-grid {
    display: grid;
    gap: 1rem;
}

.epof-grid--2 {
    grid-template-columns: 1fr 1fr;
}

@media ( max-width: 600px ) {
    .epof-grid--2 {
        grid-template-columns: 1fr;
    }
}

/* ── Fields ── */
.epof-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.epof-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #222;
}

.epof-required {
    color: #c0392b;
}

.epof-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #222;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.epof-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba( 0, 115, 170, 0.2 );
}

.epof-textarea {
    resize: vertical;
    min-height: 80px;
}

.epof-field__error {
    font-size: 0.8rem;
    color: #c0392b;
    min-height: 1.1em;
}

/* ── Product table ── */
.epof-products {
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    overflow: hidden;
}

.epof-products__row {
    display: grid;
    grid-template-columns: 1fr 100px 110px 130px 110px;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.epof-products__header {
    background: #f6f7f7;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
    border-bottom: 1px solid #e2e2e2;
}

.epof-products__row--product {
    background: #fff;
    transition: background 0.15s;
}

.epof-products__row--active {
    background: #f0f7ff;
}

.epof-products__row--product:last-child {
    border-bottom: none;
}

.epof-product-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.epof-product-desc {
    font-size: 0.8rem;
    color: #666;
}

.epof-product-sku {
    font-size: 0.8rem;
    color: #888;
    font-family: monospace;
}

.epof-col--sku,
.epof-col--price,
.epof-col--qty,
.epof-col--total {
    text-align: center;
}

.epof-col--total {
    text-align: right;
    font-weight: 600;
}

.epof-row-total {
    color: #0073aa;
}

@media ( max-width: 680px ) {
    .epof-products__row {
        grid-template-columns: 1fr 80px;
        grid-template-rows: auto auto;
    }

    .epof-col--sku,
    .epof-col--price {
        display: none;
    }

    .epof-col--qty {
        justify-self: end;
    }

    .epof-col--total {
        grid-column: 2;
        text-align: right;
    }

    .epof-products__header .epof-col--sku,
    .epof-products__header .epof-col--price {
        display: none;
    }
}

/* ── Qty stepper ── */
.epof-qty {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    width: 110px;
    margin: 0 auto;
}

.epof-qty__btn {
    background: #f6f7f7;
    border: none;
    padding: 0.35rem 0.6rem;
    font-size: 1.1rem;
    cursor: pointer;
    color: #333;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}

.epof-qty__btn:hover {
    background: #e2e2e2;
}

.epof-qty__input {
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    width: 100%;
    text-align: center;
    font-size: 0.95rem;
    padding: 0.35rem 0.25rem;
    font-family: inherit;
    color: #222;
    -moz-appearance: textfield;
}

.epof-qty__input::-webkit-outer-spin-button,
.epof-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.epof-qty__input:focus {
    outline: none;
    background: #f0f7ff;
}

/* ── Summary ── */
.epof-summary {
    background: #f0f7ff;
    border: 1px solid #c8dfef;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.epof-summary__inner {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.epof-summary__label {
    font-weight: 600;
    font-size: 1rem;
}

.epof-summary__total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0073aa;
}

.epof-summary__note {
    font-size: 0.85rem;
    color: #555;
    margin: 0.25rem 0 0;
}

/* ── Alerts ── */
.epof-alert {
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.epof-alert--error {
    background: #fdf2f2;
    border: 1px solid #f5c6c6;
    color: #7b1c1c;
}

.epof-alert--info {
    background: #f0f7ff;
    border: 1px solid #c8dfef;
    color: #1a4a6b;
}

.epof-alert ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

/* ── Loading ── */
.epof-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    padding: 1rem 0;
}

/* ── Spinner ── */
.epof-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba( 0, 115, 170, 0.3 );
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: epof-spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* ── Submit row ── */
.epof-submit-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

/* ── Button ── */
.epof-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.epof-btn--primary {
    background: #0073aa;
    color: #fff;
}

.epof-btn--primary:hover {
    background: #005d8c;
}

.epof-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Success screen ── */
.epof-success {
    text-align: center;
    padding: 3rem 1rem;
}

.epof-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.epof-success__ref {
    display: inline-block;
    background: #f6f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #0073aa;
    margin: 0.5rem 0 1rem;
}
