:root {
    --bg: #0f1419;
    --bg-card: #1a2332;
    --bg-input: #243044;
    --border: #2d3a4f;
    --text: #e8edf4;
    --text-muted: #8b9cb3;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.12);
    --info-bg: rgba(59, 130, 246, 0.1);
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.25), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(99, 102, 241, 0.12), transparent);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    padding: 1.5rem 1rem 3rem;
}

.app {
    max-width: 560px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--info-bg);
}

/* Step progress */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    position: relative;
    padding: 0 0.25rem;
}

.wizard-steps::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 5rem;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s;
}

.step-item.done .step-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.step-item.on .step-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

.step-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}

.step-item.on .step-label,
.step-item.done .step-label {
    color: var(--text);
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.35rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Form */
.field {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

.field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.field input::placeholder {
    color: #5c6b82;
}

.field input[readonly] {
    opacity: 0.85;
    cursor: default;
}

.field textarea {
    resize: vertical;
    min-height: 88px;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.field-hint code,
.path {
    font-family: var(--mono);
    font-size: 0.75rem;
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #93c5fd;
}

/* Summary chip */
.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.chip {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
}

.chip strong {
    color: var(--text);
    font-weight: 600;
}

.field-skip-cf {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.actions-split .btn-ghost {
    margin-left: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #4f46e5);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: var(--bg-input);
}

/* Alerts */
.alert {
    padding: 1rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-success {
    background: var(--success-bg);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.alert-success strong {
    color: #bbf7d0;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.alert-error {
    background: var(--error-bg);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.alert-error strong {
    color: #fee2e2;
    display: block;
    margin-bottom: 0.35rem;
}

.alert-info {
    background: var(--info-bg);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--text-muted);
    font-size: 0.85rem;
}

pre.log {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.45;
    overflow: auto;
    max-height: 200px;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-muted);
}

.link-external {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
}

.link-external:hover {
    text-decoration: underline;
}

/* Login */
.login-wrap {
    max-width: 400px;
    margin: 4rem auto;
}

.login-wrap .card {
    text-align: center;
}

.login-wrap .brand {
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-wrap .field {
    text-align: left;
}

.login-wrap .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
}

.footer-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.file-upload {
    margin-top: 0.35rem;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-upload-label {
    display: block;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.file-upload-label:hover {
    border-color: var(--accent);
    background: var(--info-bg);
    color: var(--text);
}

.file-upload:has(input:focus) .file-upload-label {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.field-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #93c5fd;
    margin: 1.5rem 0 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.field-section-title:first-of-type {
    margin-top: 0.25rem;
    padding-top: 0;
    border-top: 0;
}

.color-group {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border);
}

.color-group:first-of-type {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: 0;
}

.color-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.85rem;
}

.color-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.color-row input[type="color"] {
    width: 48px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    cursor: pointer;
}

.color-row input[type="text"] {
    padding: 0.55rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.color-row label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

@media (max-width: 480px) {
    .wizard-steps .step-label {
        font-size: 0.58rem;
    }
    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    .color-row {
        grid-template-columns: 44px 1fr;
    }
    .color-row label {
        grid-column: 1 / -1;
    }
}
