/* =============================================================
   Nexus Fine Tech — Guided Automation Application Wizard
   Responsive step form · glow progress · inline validation
   ============================================================= */

/* ── Wizard Card Shell ──────────────────────────────────────── */
.wizard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.wizard-body {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* ── Persistent Glow Progress Bar ───────────────────────────── */
.wizard-progress {
    position: relative;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    flex-shrink: 0;
}

.light .wizard-progress { background: rgba(15, 23, 42, 0.08); }

.wizard-progress-fill {
    position: relative;
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #22D3EE, #8B5CF6);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.6), 0 0 24px rgba(139, 92, 246, 0.4);
    border-radius: 0 2px 2px 0;
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.wizard-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%);
    animation: progress-shimmer 2.4s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* ── Wizard Header ──────────────────────────────────────────── */
.wizard-header {
    margin-bottom: 24px;
}

.wizard-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.015em;
    margin-bottom: 4px;
}

.wizard-header p {
    font-size: 0.875rem;
    color: var(--text-2);
}

/* ── Step Indicators ────────────────────────────────────────── */
.wizard-indicators {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-top: 4px;
    width: 100%;
}

.wizard-indicators-line {
    position: absolute;
    top: 20px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    z-index: 0;
}

.light .wizard-indicators-line { background: rgba(15, 23, 42, 0.1); }

.wizard-indicators-line-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22D3EE, #8B5CF6);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
    border-radius: 1px;
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.wizard-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.wizard-indicator-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-1);
    border: 2px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.35s var(--ease-out-expo);
}

.light .wizard-indicator-dot {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
}

.dot-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-3);
    transition: color 0.3s ease, opacity 0.3s ease;
}

.dot-check {
    position: absolute;
    color: #fff;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.3s ease, transform 0.35s var(--ease-spring);
}

.wizard-indicator.is-active .wizard-indicator-dot {
    border-color: var(--cyan);
    background: var(--cyan-soft);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12), 0 0 18px var(--cyan-glow);
}

.wizard-indicator.is-active .dot-num { color: var(--cyan); }

.wizard-indicator.is-completed .wizard-indicator-dot {
    border-color: transparent;
    background: var(--gradient-accent);
    box-shadow: 0 0 14px var(--cyan-glow);
}

.wizard-indicator.is-completed .dot-num { opacity: 0; }
.wizard-indicator.is-completed .dot-check { opacity: 1; transform: scale(1); }

.wizard-indicator-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
    transition: color 0.3s ease;
}

.wizard-indicator.is-active .wizard-indicator-label { color: var(--cyan); }
.wizard-indicator.is-completed .wizard-indicator-label { color: var(--text-2); }

/* ── Wizard Form Container & Steps ──────────────────────────── */
#contactForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

.wizard-steps {
    width: 100%;
    position: relative;
}

.wizard-step {
    display: none;
    width: 100%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.wizard-step.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ── Step Header ────────────────────────────────────────────── */
.step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.step-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-header h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.step-header p {
    font-size: 0.8125rem;
    color: var(--text-2);
}

/* ── Step Hint ──────────────────────────────────────────────── */
.step-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.12);
    border-radius: 12px;
}

.step-hint svg {
    color: var(--cyan);
    flex-shrink: 0;
    margin-top: 2px;
}

.step-hint p {
    font-size: 0.8125rem;
    color: var(--text-2);
    line-height: 1.5;
}

/* ── Form Fields ────────────────────────────────────────────── */
.field {
    margin-bottom: 18px;
    width: 100%;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 8px;
}

.req {
    color: #F87171;
    font-weight: 700;
}

.field-optional {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-3);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.light .field-optional { background: rgba(15, 23, 42, 0.05); }

.field-input,
.field-select,
.field-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 0.9375rem;
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.light .field-input,
.light .field-select,
.light .field-textarea {
    background: rgba(255, 255, 255, 0.8);
}

.field-input::placeholder,
.field-textarea::placeholder {
    color: var(--text-3);
}

.field-textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.6;
}

.field-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394A3B8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.field-select:invalid { color: var(--text-3); }
.field-select option { background: var(--bg-1); color: var(--text-1); }
.light .field-select option { background: #fff; color: #0F172A; }

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--cyan);
    background: rgba(34, 211, 238, 0.04);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14), 0 0 18px rgba(34, 211, 238, 0.08);
}

/* ── Inline Validation ──────────────────────────────────────── */
.field-error {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #F87171;
    margin-top: 6px;
}

.field.has-error .field-error {
    display: flex;
}

.field.has-error .field-input,
.field.has-error .field-select,
.field.has-error .field-textarea {
    border-color: rgba(248, 113, 113, 0.6);
    background: rgba(248, 113, 113, 0.04);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

/* ── Chip Group (multi-select) ──────────────────────────────── */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.chip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: all 0.25s ease;
    user-select: none;
}

.light .chip span { background: rgba(255, 255, 255, 0.7); }

.chip span::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.light .chip span::before { border-color: rgba(15, 23, 42, 0.25); }

.chip:hover span {
    border-color: var(--glass-border-hover);
    color: var(--text-1);
}

.chip input:checked + span {
    color: var(--text-1);
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.12);
}

.chip input:checked + span::before {
    border-color: var(--cyan);
    background: var(--cyan);
    box-shadow: inset 0 0 0 2.5px var(--bg-1);
}

/* ── Review Step ────────────────────────────────────────────── */
.review-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 4px 16px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.light .review-group { background: rgba(255, 255, 255, 0.6); }

.review-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.review-row:last-child { border-bottom: none; }

.review-data {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.review-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
}

.review-value {
    font-size: 0.875rem;
    color: var(--text-1);
    word-break: break-word;
    line-height: 1.5;
}

.review-value-block {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-edit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cyan);
    padding: 4px 10px;
    border-radius: 8px;
    transition: background 0.25s ease, color 0.25s ease;
}

.review-edit:hover {
    background: var(--cyan-soft);
    color: var(--text-1);
}

.review-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.5;
}

.review-note svg { flex-shrink: 0; color: var(--violet); }

/* ── Wizard Navigation ──────────────────────────────────────── */
.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    width: 100%;
}

.wizard-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.03em;
}

.wizard-nav-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

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

/* ── Responsive Adjustments ─────────────────────────────────── */
@media (max-width: 640px) {
    .wizard-body { padding: 22px 18px; }

    .wizard-indicators-line {
        left: 20px;
        right: 20px;
        top: 18px;
    }

    .wizard-indicator-dot { width: 30px; height: 30px; }
    .dot-num { font-size: 0.6875rem; }
    .wizard-indicator-label { font-size: 0.625rem; }

    .chip span { width: 100%; justify-content: flex-start; }
    .chip { width: 100%; }

    .wizard-nav {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .wizard-nav-buttons {
        margin-left: 0;
        width: 100%;
    }

    .wizard-nav-buttons .btn-primary,
    .wizard-nav-buttons .btn-secondary {
        flex: 1;
        width: 100%;
    }

    .wizard-counter { text-align: center; }
}

@media (max-width: 380px) {
    .wizard-indicator-label { display: none; }
    .wizard-indicators-line { top: 15px; }
}