*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --bg: #0f1419;
    --surface: #1a222d;
    --border: rgba(255, 255, 255, 0.08);
    --text: rgba(255, 255, 255, 0.95);
    --text-dim: rgba(255, 255, 255, 0.5);
    --text-light: rgba(255, 255, 255, 0.75);
    --accent: #4ea3dc;
    --accent-hover: #7dbde8;
    --accent-glow: rgba(78, 163, 220, 0.08);
    --error: #ef4444;
    --success: #22c55e;
    --radius: 8px;
    --radius-lg: 12px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Header */
header {
    padding: 2.5rem 1.5rem 1rem;
    text-align: center;
}
.header-inner h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 300;
    letter-spacing: -0.02em;
}
.subtitle {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
}
.tab {
    background: transparent;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s var(--ease);
}
.tab:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Main */
main {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}
.card h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}
.card > p {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.3s var(--ease);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

button[type="submit"],
button#start-processing,
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.65rem 1.75rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s var(--ease);
    text-align: center;
}
button[type="submit"]:hover,
button#start-processing:hover,
.btn:hover {
    background: var(--accent-hover);
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    margin-left: 0.75rem;
    transition: all 0.3s var(--ease);
}
.btn-secondary:hover { border-color: rgba(255, 255, 255, 0.2); color: var(--text-light); }

/* Upload area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: border-color 0.3s var(--ease);
    cursor: pointer;
}
.upload-area.dragover { border-color: var(--accent); }
.upload-text { color: var(--text-dim); }
.upload-text button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: inherit;
    text-decoration: underline;
}
.upload-hint {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.6;
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s var(--ease);
}

/* Status messages */
.status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.status.info { background: var(--accent-glow); color: var(--accent); }
.status.success { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.status.error { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.hidden { display: none !important; }

/* Steps */
.step { display: none; margin-top: 1.5rem; }
.step.active { display: block; }
.step h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}
.step-desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

/* Processing spinner */
.processing-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-message {
    color: var(--error);
    margin-bottom: 1rem;
}

/* Done */
#phase-step-done .btn {
    margin-right: 0.75rem;
}
#done-text {
    color: var(--success);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 480px) {
    .card { padding: 1.25rem; }
    .form-row { grid-template-columns: 1fr; }
}
