/* =========================================
   KLP HACCP Generator – Form Styles
   Matches Kitchen LaunchPad design system
   ========================================= */

.klp-haccp-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* ── Progress Bar ────────────────────────── */
.klp-haccp-progress {
    height: 6px;
    background: var(--color-border, #e5e7eb);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.klp-haccp-progress-bar {
    height: 100%;
    background: var(--color-orange, #e8651a);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 16.66%;
}

.klp-haccp-step-indicator {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-gray, #6b7280);
    margin-bottom: 30px;
}

/* ── Step Container ──────────────────────── */
.klp-haccp-step {
    display: none;
}

.klp-haccp-step.active {
    display: block;
    animation: klpFadeIn 0.3s ease;
}

@keyframes klpFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.klp-haccp-step-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.6rem;
    color: var(--color-navy, #1a2e5a);
    margin-bottom: 8px;
}

.klp-haccp-step-desc {
    color: var(--color-gray, #6b7280);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* ── Fields ──────────────────────────────── */
.klp-field {
    margin-bottom: 18px;
}

.klp-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-navy, #1a2e5a);
    font-size: 0.9rem;
}

.klp-field .req {
    color: var(--color-orange, #e8651a);
}

.klp-field input[type="text"],
.klp-field input[type="email"],
.klp-field input[type="tel"],
.klp-field input[type="number"],
.klp-field textarea,
.klp-field select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-family: var(--font-body, 'Source Sans 3', sans-serif);
    font-size: 0.95rem;
    color: var(--color-text, #1f2937);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    background: #fff;
}

.klp-field input:focus,
.klp-field textarea:focus,
.klp-field select:focus {
    outline: none;
    border-color: var(--color-orange, #e8651a);
    box-shadow: 0 0 0 3px rgba(232, 101, 26, 0.15);
}

.klp-field textarea {
    resize: vertical;
    min-height: 80px;
}

.klp-field select {
    appearance: none;
    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='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.klp-field.has-error input,
.klp-field.has-error textarea,
.klp-field.has-error select {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.klp-field .klp-field-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
}

.klp-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .klp-field-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Checkbox ────────────────────────────── */
.klp-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    font-size: 0.85rem !important;
    color: var(--color-text, #1f2937) !important;
    cursor: pointer;
    line-height: 1.4;
}

.klp-checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

.klp-checkbox-label a {
    color: var(--color-orange, #e8651a);
    text-decoration: underline;
}

/* ── Repeater ────────────────────────────── */
.klp-repeater-item {
    background: var(--color-light, #f5f6f8);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    padding: 20px;
    margin-bottom: 15px;
}

.klp-repeater-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--color-navy, #1a2e5a);
}

.klp-repeater-remove {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #dc2626;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.klp-repeater-remove:hover {
    color: #991b1b;
}

.klp-repeater-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 2px dashed var(--color-border, #e5e7eb);
    color: var(--color-orange, #e8651a);
    padding: 10px 20px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
    width: 100%;
    justify-content: center;
}

.klp-repeater-add:hover {
    border-color: var(--color-orange, #e8651a);
    background: rgba(232, 101, 26, 0.05);
}

/* ── Summary / Price Box ─────────────────── */
.klp-haccp-summary {
    background: var(--color-light, #f5f6f8);
    border-radius: var(--radius-md, 12px);
    padding: 25px;
    margin: 25px 0;
}

.klp-haccp-summary h3 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--color-navy, #1a2e5a);
    margin-bottom: 12px;
}

.klp-haccp-summary ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.klp-haccp-summary li {
    margin-bottom: 8px;
    color: var(--color-text, #1f2937);
    line-height: 1.5;
}

.klp-haccp-price-box {
    background: #fff;
    border: 2px solid var(--color-orange, #e8651a);
    border-radius: var(--radius-sm, 6px);
    padding: 15px 20px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.klp-haccp-price-label {
    font-weight: 600;
    color: var(--color-navy, #1a2e5a);
}

.klp-haccp-price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-orange, #e8651a);
    font-family: var(--font-heading, 'Playfair Display', serif);
}

.klp-haccp-price-note {
    font-size: 0.8rem;
    color: var(--color-gray, #6b7280);
}

/* ── Navigation ──────────────────────────── */
.klp-haccp-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

.klp-btn-prev {
    background: var(--color-light, #f5f6f8);
    color: var(--color-navy, #1a2e5a);
    border: 2px solid var(--color-border, #e5e7eb);
    padding: 10px 24px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
}

.klp-btn-prev:hover {
    background: var(--color-border, #e5e7eb);
}

.klp-btn-next,
.klp-btn-submit {
    margin-left: auto;
}

/* ── Success Message ─────────────────────── */
.klp-haccp-success {
    text-align: center;
    padding: 50px 20px;
}

.klp-haccp-success-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #d1fae5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.klp-haccp-success h2 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--color-navy, #1a2e5a);
    margin-bottom: 10px;
}

.klp-haccp-success-sub {
    color: var(--color-gray, #6b7280);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* ── Loading Overlay ─────────────────────── */
.klp-haccp-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: var(--radius-md, 12px);
    min-height: 300px;
}

.klp-haccp-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border, #e5e7eb);
    border-top-color: var(--color-orange, #e8651a);
    border-radius: 50%;
    animation: klpSpin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes klpSpin {
    to { transform: rotate(360deg); }
}

.klp-haccp-loading p {
    font-weight: 600;
    color: var(--color-navy, #1a2e5a);
}

.klp-haccp-loading-sub {
    font-weight: 400 !important;
    color: var(--color-gray, #6b7280) !important;
    font-size: 0.85rem;
}

/* ── Status Page ─────────────────────────── */
.klp-haccp-status-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
}

.klp-haccp-status-header {
    text-align: center;
    margin-bottom: 30px;
}

.klp-haccp-status-header h1 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--color-navy, #1a2e5a);
}

.klp-haccp-status-company {
    color: var(--color-gray, #6b7280);
}

/* Timeline */
.klp-haccp-timeline {
    position: relative;
    padding-left: 50px;
    margin: 30px 0;
    max-width: 500px;
}

.klp-haccp-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 16px;
    bottom: 16px;
    width: 3px;
    background: var(--color-border, #e5e7eb);
}

.klp-timeline-step {
    position: relative;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.3s ease;
}

.klp-timeline-step.done {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.klp-timeline-step.current {
    background: #fff7ed;
    border: 2px solid var(--color-orange, #e8651a);
}

.klp-timeline-step:not(.done):not(.current) {
    opacity: 0.4;
}

.klp-timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-border, #e5e7eb);
    border: 3px solid #fff;
    position: absolute;
    left: -50px;
    top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    font-weight: 700;
    z-index: 1;
}

.klp-timeline-step.done .klp-timeline-dot {
    background: #059669;
}

.klp-timeline-step.current .klp-timeline-dot {
    background: var(--color-orange, #e8651a);
    box-shadow: 0 0 0 4px rgba(232, 101, 26, 0.25);
    animation: klpPulse 2s ease infinite;
}

.klp-timeline-step:not(.done):not(.current) .klp-timeline-dot {
    background: #fff;
    border: 3px solid var(--color-border, #e5e7eb);
    color: transparent;
}

@keyframes klpPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(232, 101, 26, 0.25); }
    50%      { box-shadow: 0 0 0 8px rgba(232, 101, 26, 0.1); }
}

.klp-timeline-content strong {
    color: var(--color-navy, #1a2e5a);
    font-size: 0.95rem;
}

.klp-timeline-step.done .klp-timeline-content strong {
    color: #059669;
}

.klp-timeline-step.current .klp-timeline-content strong {
    color: var(--color-orange, #e8651a);
}

.klp-timeline-step:not(.done):not(.current) .klp-timeline-content strong {
    color: var(--color-gray, #6b7280);
}

.klp-timeline-content p {
    color: var(--color-gray, #6b7280);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Payment section on status page */
.klp-haccp-payment-section {
    background: var(--color-light, #f5f6f8);
    border-radius: var(--radius-md, 12px);
    padding: 30px;
    text-align: center;
    margin: 25px 0;
}

.klp-haccp-payment-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-orange, #e8651a);
    font-family: var(--font-heading, 'Playfair Display', serif);
    margin-bottom: 20px;
}

.klp-haccp-pay-btn {
    font-size: 1.1rem;
    padding: 14px 40px;
}

.klp-haccp-wire-info {
    text-align: left;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

.klp-haccp-wire-info h3 {
    color: var(--color-navy, #1a2e5a);
    font-size: 1rem;
    margin-bottom: 10px;
}

.klp-haccp-wire-info table {
    width: 100%;
    margin-bottom: 10px;
}

.klp-haccp-wire-info td {
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.klp-haccp-wire-info td:first-child {
    color: var(--color-gray, #6b7280);
    width: 40%;
}

.klp-vs {
    color: var(--color-orange, #e8651a);
    font-size: 1.1rem;
}

.klp-haccp-wire-note {
    font-size: 0.85rem;
    color: var(--color-gray, #6b7280);
    margin-top: 10px;
}

/* Status alerts */
.klp-haccp-status-alert {
    padding: 20px;
    border-radius: var(--radius-sm, 6px);
    margin: 20px 0;
}

.klp-haccp-status-alert--success {
    background: #d1fae5;
    border: 1px solid #059669;
    color: #065f46;
}

.klp-haccp-status-alert--error {
    background: #fee2e2;
    border: 1px solid #dc2626;
    color: #991b1b;
}

.klp-haccp-status-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--color-gray, #6b7280);
    font-size: 0.9rem;
}

.klp-haccp-status-footer a {
    color: var(--color-orange, #e8651a);
}

.klp-haccp-status-error {
    text-align: center;
    padding: 40px;
    color: var(--color-gray, #6b7280);
}

/* ── Feedback / Revision Section ─────────── */
.klp-haccp-feedback-section {
    background: var(--color-light, #f5f6f8);
    border-radius: var(--radius-md, 12px);
    padding: 25px;
    margin: 25px 0;
}

.klp-haccp-feedback-section h3 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--color-navy, #1a2e5a);
    margin-bottom: 8px;
}

.klp-haccp-feedback-section p {
    color: var(--color-gray, #6b7280);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.klp-haccp-feedback-section textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-family: var(--font-body, 'Source Sans 3', sans-serif);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
}

.klp-haccp-feedback-section textarea:focus {
    outline: none;
    border-color: var(--color-orange, #e8651a);
    box-shadow: 0 0 0 3px rgba(232, 101, 26, 0.15);
}

.klp-haccp-feedback-section .btn {
    margin-top: 10px;
}
