/* ═══════════════════════════════════════════════════════
   CICD Initializer - Opus DevOps Platform
   Color Palette: Light background, dark text, accent pops
   ═══════════════════════════════════════════════════════ */

:root {
    /* Primary */
    --primary-dark: #004851;
    --primary-light: #00968F;

    /* Secondary */
    --secondary-green: #4C9C2E;
    --secondary-blue-light: #41BBC9;
    --secondary-blue-dark: #004A98;

    /* Highlights */
    --highlight-orange: #FF8200;
    --highlight-green: #93D500;
    --highlight-blue: #00A0E0;

    /* Text */
    --text-primary: #131E29;
    --text-secondary: #4A5568;
    --text-muted: #8494A7;
    --text-light: #B3B6BD;

    /* Surfaces */
    --bg: #FFFFFF;
    --bg-subtle: #F7F8FA;
    --bg-muted: #EEF1F5;
    --border: #DFE3EA;
    --border-focus: var(--primary-light);

    /* Functional */
    --success: var(--secondary-green);
    --error: #DC3545;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 3px rgba(19, 30, 41, 0.06);
    --shadow-md: 0 4px 12px rgba(19, 30, 41, 0.08);
    --transition: 0.15s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    border-bottom: 1px solid var(--border);
    padding: 14px 32px;
    background: var(--bg);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.main-content {
    flex: 1;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 32px;
}

/* ── Step Indicator ── */
.steps {
    display: flex;
    gap: 6px;
    margin-bottom: 40px;
}

.step {
    flex: 1;
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step.completed {
    cursor: pointer;
}

.step-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    transition: background var(--transition);
}

.step.active .step-bar {
    background: var(--primary-light);
}

.step.completed .step-bar {
    background: var(--secondary-green);
}

.step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    transition: color var(--transition);
}

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

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

.step-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-muted);
    color: var(--text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}

.step.active .step-number {
    background: var(--primary-light);
    color: #fff;
}

.step.completed .step-number {
    background: var(--secondary-green);
    color: #fff;
}

/* ── Step Content ── */
.step-content {
    min-height: 380px;
}

.step-header {
    margin-bottom: 28px;
}

.step-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.step-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ── Form Fields ── */
.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.required {
    color: var(--highlight-orange);
    margin-left: 2px;
}

.field input[type="text"],
.field select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field input.mono,
.field select {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
}

.field input:focus,
.field select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 150, 143, 0.1);
}

.hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.error {
    display: block;
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Derived Value Display ── */
.derived-value {
    padding: 10px 14px;
    background: rgba(0, 150, 143, 0.06);
    border: 1px solid rgba(0, 150, 143, 0.15);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.derived-label {
    font-weight: 600;
    color: var(--primary-light);
}

.derived-value code {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-weight: 500;
}

/* ── Radio Cards (Pipeline Type) ── */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
}

.radio-card:hover {
    border-color: var(--primary-light);
    background: var(--bg-subtle);
}

.radio-card.selected {
    border-color: var(--primary-light);
    background: rgba(0, 150, 143, 0.04);
}

.radio-card input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--primary-light);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-content strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.radio-content span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Grid Select (Tech Stack) ── */
.grid-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.grid-option {
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.grid-option:hover {
    border-color: var(--primary-light);
    background: var(--bg-subtle);
}

.grid-option.selected {
    border-color: var(--primary-light);
    background: rgba(0, 150, 143, 0.04);
}

.grid-option strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.grid-option span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Toggle ── */
.toggle-field {
    margin-bottom: 24px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.toggle input {
    display: none;
}

.toggle-track {
    width: 42px;
    height: 24px;
    border-radius: 12px;
    background: var(--border);
    position: relative;
    transition: background var(--transition);
    flex-shrink: 0;
}

.toggle input:checked + .toggle-track {
    background: var(--primary-light);
}

.toggle-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: left var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-track .toggle-thumb {
    left: 21px;
}

/* ── Summary Card ── */
.summary-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.summary-card h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.summary-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.summary-label {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 120px;
}

.summary-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    padding: 0;
}

/* ── File Preview ── */
.file-preview h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.file-tabs {
    display: flex;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-x: auto;
}

.file-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.file-tab:hover {
    color: var(--text-primary);
}

.file-tab.active {
    background: var(--bg);
    color: var(--primary-dark);
    border-bottom-color: var(--primary-light);
    font-weight: 500;
}

.file-content {
    margin: 0;
    padding: 20px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    color: var(--text-primary);
    font-size: 12.5px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.7;
    overflow-x: auto;
    max-height: 450px;
    white-space: pre;
    tab-size: 2;
}

/* ── Navigation Bar ── */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

/* ── Buttons ── */
.btn {
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    letter-spacing: 0.01em;
}

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

.btn-primary {
    background: var(--primary-dark);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-download {
    background: var(--secondary-green);
    color: #fff;
}

.btn-download:hover {
    background: #3D8624;
    box-shadow: 0 2px 8px rgba(76, 156, 46, 0.3);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .main-content {
        padding: 24px 16px;
    }

    .grid-select {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .step-label span {
        display: none;
    }
}
