/* =============================================================================
   [novia-ecert-purchase] wizard styles
   ============================================================================= */

/* Reset within the wizard so host-theme styles don't leak in */
.ecp-hero, .ecp-main, .ecp-wizard, .ecp-wizard * {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ----- Hero banner ----- */
.ecp-hero {
    background: linear-gradient(90deg, #1d4ed8 0%, #1e40af 100%);
    padding: 3rem 1rem;
    color: #fff;
}
.ecp-hero-inner {
    max-width: 80rem;
    margin: 0 auto;
    text-align: center;
}
.ecp-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
}
h1.ecp-hero-title {
    color: #fff;
}
.ecp-hero-subtitle {
    margin: 0.75rem auto 0;
    max-width: 42rem;
    font-size: 1rem;
    color: rgba(219, 234, 254, 0.95);
    line-height: 1.5;
}
.ecp-hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}
.ecp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.ecp-hero-badge svg {
    width: 1rem;
    height: 1rem;
}

/* ----- Main ----- */
.ecp-main {
    background: #f9fafb;
    padding: 2.5rem 1rem;
    min-height: 40vh;
}
.ecp-container {
    max-width: 80rem;
    margin: 0 auto;
}
.ecp-wizard {
    max-width: 42rem;
    margin: 0 auto;
}

/* ----- Steps header ----- */
.ecp-steps-header { margin-bottom: 2rem; }
.ecp-steps-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}
.ecp-step-label {
    font-weight: 500;
}
.ecp-step-label.is-active {
    color: #1cb886;
}
.ecp-progress {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}
.ecp-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 9999px;
    transition: width 200ms ease;
}

/* ----- Card container ----- */
.ecp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.ecp-card-body {
    padding: 1.75rem 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.ecp-step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
.ecp-step-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

/* ----- Fields ----- */
.ecp-field-group, .ecp-field-row { margin-bottom: 1em; }
.ecp-field-group { display: flex; flex-direction: column; gap: 0.375rem; }
.ecp-field-label { font-size: 0.875rem; font-weight: 500; color: #374151; }
.ecp-field-hint { font-size: 0.75rem; color: #6b7280; margin: 0; }

.ecp-field-input, .ecp-field-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    color: #111827;
    outline: none;
    transition: border-color 150ms, box-shadow 150ms;
}
.ecp-field-input:focus, .ecp-field-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.ecp-field-select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.22 4.47a.75.75 0 0 1 1.06 0L6 7.19l2.72-2.72a.75.75 0 1 1 1.06 1.06L6.53 8.78a.75.75 0 0 1-1.06 0L2.22 5.53a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
.ecp-field-select:disabled, .ecp-field-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.ecp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 560px) {
    .ecp-field-row { grid-template-columns: 1fr; }
}

/* ----- Radio cards ----- */
.ecp-radio-group {
    display: grid;
    gap: 0.625rem;
    margin-top: 0.25rem;
}
.ecp-radio-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms;
}
.ecp-radio-card:hover { background: #f9fafb; }
.ecp-radio-card input[type="radio"] {
    position: absolute;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
.ecp-radio-dot {
    width: 1rem; height: 1rem; border: 1px solid #2563eb;
    border-radius: 9999px; display: inline-flex;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ecp-radio-card input[type="radio"]:checked ~ .ecp-radio-dot::after {
    content: ""; width: 0.5rem; height: 0.5rem;
    background: #2563eb; border-radius: 9999px;
}
.ecp-radio-card input[type="radio"]:checked + .ecp-radio-dot {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.ecp-radio-body { display: flex; flex-direction: column; gap: 0.125rem; }
.ecp-radio-body strong { font-size: 0.9375rem; font-weight: 600; color: #111827; }
.ecp-radio-body em { font-style: normal; font-size: 0.8125rem; color: #6b7280; }

/* ----- Checkbox field ----- */
.ecp-checkbox-field { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.875rem; color: #374151; }
.ecp-checkbox-field a { color: #2563eb; text-decoration: underline; }

/* ----- Info panels ----- */
.ecp-info {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    border: 1px solid transparent;
}
.ecp-info strong { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.ecp-info-neutral { background: #f3f4f6; border-color: #e5e7eb; color: #374151; }
.ecp-info-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ecp-info-warning { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

/* ----- Account switch link ----- */
.ecp-account-switcher {
    text-align: center;
    /* margin-top: 0.25rem; */
    margin-bottom: 1.5em;
}
.ecp-account-switcher a {
    color: #2563eb; font-weight: 500; text-decoration: underline; font-size: 0.875rem;
}

/* ----- Optional-label tag ----- */
.ecp-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* ----- Book/Page group visual grouping ----- */
.ecp-bookpage-group {
    border: 1px dashed #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ----- Order picker (internal/returning-user search) ----- */
.ecp-order-picker {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    font-size: 0.875rem;
}
.ecp-order-picker-head {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 1fr 1.5fr 0.7fr;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.ecp-order-picker-body {
    max-height: 14rem;
    overflow-y: auto;
    background: #fff;
}
.ecp-order-picker-row {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 1fr 1.5fr 0.7fr;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    cursor: default;
    transition: background-color 120ms;
}
.ecp-order-picker-row:hover { background: #f9fafb; }
.ecp-order-picker-row.is-selected { background: #eef6ff; }
.ecp-order-picker-row .ecp-pick-btn {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    background: #1cb886;
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}
.ecp-order-picker-row.is-selected .ecp-pick-btn { background: #6b7280; }
.ecp-order-picker-row .ecp-pick-btn:hover { background: #17a378; }
.ecp-order-picker-empty,
.ecp-order-picker-loading,
.ecp-order-picker-none {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.8125rem;
}

@media (max-width: 640px) {
    .ecp-order-picker-head,
    .ecp-order-picker-row {
        grid-template-columns: 1fr 1fr;
    }
    .ecp-order-picker-head > span:nth-child(3),
    .ecp-order-picker-head > span:nth-child(4),
    .ecp-order-picker-row > span:nth-child(3),
    .ecp-order-picker-row > span:nth-child(4) { display: none; }
}

/* ----- Summary table ----- */
.ecp-summary {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}
.ecp-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9375rem;
}
.ecp-summary-row:last-child { border-bottom: 0; }
.ecp-summary-row span { color: #6b7280; }
.ecp-summary-row strong { color: #111827; font-weight: 600; text-align: right; }
.ecp-summary-total { background: #f9fafb; }

/* ----- Footer & buttons ----- */
.ecp-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.ecp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 150ms, color 150ms, border-color 150ms;
}
.ecp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ecp-btn-primary {
    background: #1cb886;
    color: #fff;
    border-color: #1cb886;
}
.ecp-btn-primary:hover:not(:disabled) { background: #17a378; border-color: #17a378; }
.ecp-btn-secondary {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.ecp-btn-secondary:hover { background: #f3f4f6; }
