/* ============================================
   WebsiteBox Setup Wizard
   Extends main style.css — do not duplicate base variables
   ============================================ */

/* --- Page layout --- */
html {
    scroll-snap-type: none;
}

.setup-main {
    padding-top: 60px; /* nav height */
    min-height: 100vh;
}

.setup-header {
    text-align: center;
    padding: 40px 0 36px;
}

.setup-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.setup-header-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* --- Progress indicator --- */
.progress-nav {
    margin-bottom: 48px;
    position: relative;
}

.progress-track {
    position: absolute;
    top: 19px; /* center of circle (38px/2 = 19px) */
    left: calc(10% + 19px); /* offset to start at first circle center */
    right: calc(10% + 19px); /* offset to end at last circle center */
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.progress-fill {
    height: 3px;
    background: var(--accent);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    list-style: none;
    position: relative;
    z-index: 1;
    padding: 0;
    margin: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.progress-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    transition: color 0.2s;
}

/* Active step */
.progress-step.active .progress-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.progress-step.active .progress-label {
    color: var(--accent);
}

/* Completed step */
.progress-step.completed .progress-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-size: 0; /* hide number, show checkmark via content */
}

.progress-step.completed .progress-circle::before {
    content: '✓';
    font-size: 1rem;
    font-weight: 700;
}

.progress-step.completed .progress-label {
    color: var(--text-secondary);
}

/* --- Step containers --- */
.setup-steps {
    max-width: 680px;
    margin: 0 auto;
    padding-bottom: 64px;
}

.setup-step {
    animation: fadeIn 0.15s ease;
}

.setup-step.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .setup-step { animation: none; }
}

.step-heading {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.step-intro {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: 40px;
}

/* --- Info cards --- */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 28px;
}

.info-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
}

.info-card-tip {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
}

.info-card-tip h3 {
    color: var(--accent);
}

/* --- Provider table --- */
.provider-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
    font-size: 0.9375rem;
}

.provider-table th,
.provider-table td {
    text-align: left;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.provider-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-card);
}

.provider-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.provider-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.provider-table td {
    color: var(--text-secondary);
}

.provider-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.provider-table tr:last-child td {
    border-bottom: none;
}

.provider-table tbody tr:hover td {
    background: var(--bg-card);
}

/* --- Requirements list --- */
.req-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.req-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.req-list .check {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

/* --- DNS step list --- */
.dns-steps {
    list-style: none;
    counter-reset: dns-counter;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin: 0 0 8px;
}

.dns-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    counter-increment: dns-counter;
}

.dns-steps li::before {
    content: counter(dns-counter) '.';
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
    width: 16px;
    text-align: right;
}

.dns-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 10px !important;
    font-style: italic;
}

/* --- Registrar list --- */
.registrar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.registrar-list li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.registrar-list li::before {
    content: '→ ';
    color: var(--accent);
}

/* --- Form elements --- */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.form-input.valid {
    border-color: var(--accent);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input-mono {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    letter-spacing: 0.05em;
}

.form-input-narrow {
    width: 100px;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.form-error {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 5px;
    line-height: 1.5;
}

.form-error.hidden {
    display: none;
}

.required-mark {
    color: #ef4444;
    margin-left: 2px;
}

.optional-mark {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

/* --- Checkbox --- */
.step-check-group {
    margin: 36px 0;
    border-top: 1px solid var(--border);
    padding-top: 28px;
}

.step-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    user-select: none;
}

.step-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-card);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.step-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.step-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-checkbox input[type="checkbox"]:focus-visible + .checkbox-custom {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Step actions --- */
.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 44px;
    align-items: center;
}

.step-actions .btn-ghost {
    min-width: 100px;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.step-actions-final {
    flex-wrap: wrap;
}

/* --- Subsection heading --- */
.subsection-heading {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 36px;
}

/* --- Config sections --- */
.config-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 28px 28px;
    margin-bottom: 28px;
}

.config-section fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.config-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 12px;
    display: block;
}

/* --- Toggle switch --- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.toggle-row:first-of-type {
    padding-top: 0;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    display: block;
    width: 44px;
    height: 24px;
    background: var(--border-light);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-track {
    background: var(--accent);
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

.toggle-switch input[type="checkbox"]:focus-visible ~ .toggle-track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Sub-options (indented conditionally visible) --- */
.sub-options {
    padding: 16px 0 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.sub-options.hidden {
    display: none;
}

/* --- Radio group --- */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    user-select: none;
}

.radio-label input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-label:hover {
    color: var(--text-primary);
}

/* --- Color swatches --- */
.color-swatches {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.swatch-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.swatch {
    width: 52px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
    background: var(--swatch-bg);
}

/* Accent stripe at bottom third of swatch */
.swatch::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--swatch-accent);
}

.swatch-label:hover .swatch {
    border-color: var(--border-light);
    transform: scale(1.05);
}

.swatch-label.selected .swatch {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.swatch-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.swatch-label.selected .swatch-name {
    color: var(--accent);
}

/* --- Password row --- */
.password-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.password-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.password-input-wrap .form-input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
    font-size: 1rem;
    transition: color 0.15s;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* --- Advanced section --- */
.config-advanced {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
}

.advanced-toggle {
    width: 100%;
    background: var(--bg-card);
    border: none;
    padding: 16px 24px;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.15s;
}

.advanced-toggle:hover {
    color: var(--text-secondary);
}

.advanced-toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.75rem;
}

.advanced-toggle[aria-expanded="true"] .advanced-toggle-icon {
    transform: rotate(90deg);
}

.advanced-options {
    padding: 12px 24px 20px;
    border-top: 1px solid var(--border);
}

.advanced-options.hidden {
    display: none;
}

.advanced-options .toggle-row:last-of-type {
    padding-bottom: 0;
}

/* --- Terminal wrapper for step 5 --- */
.terminal-wrapper {
    margin-bottom: 32px;
    position: relative;
}

/* Copy button inside terminal bar */
.copy-btn {
    margin-left: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.copy-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* Make terminal bar flex so copy button sits at right */
.terminal-wrapper .terminal-bar {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Wrap long command text */
#command-output {
    white-space: pre-wrap;
    word-break: break-all;
    text-align: left;
}

/* --- Install summary --- */
.install-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.install-summary h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.summary-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.summary-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.summary-list .check {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .setup-header {
        padding: 40px 0 28px;
    }

    .setup-header h1 {
        font-size: 1.875rem;
    }

    .progress-label {
        font-size: 0.6875rem;
        max-width: 60px;
    }

    .progress-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .progress-track {
        top: 16px;
    }

    .step-heading {
        font-size: 1.25rem;
    }

    .provider-table {
        font-size: 0.875rem;
    }

    .provider-table th,
    .provider-table td {
        padding: 8px 10px;
    }

    .password-row {
        flex-direction: column;
    }

    .password-input-wrap {
        width: 100%;
    }

    .color-swatches {
        gap: 8px;
    }

    .swatch {
        width: 40px;
        height: 28px;
    }

    .step-actions {
        flex-wrap: wrap;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .progress-label {
        display: none;
    }

    .progress-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .progress-track {
        top: 14px;
    }
}
