/* MBC Inspired Design System */

:root {
    --bg-base: #f3f4f6;
    /* gray-100 */
    --text-primary: #111827;
    /* gray-900 */
    --text-muted: #4b5563;
    /* gray-600 */
    --primary-color: #E6B800;
    /* aureus-gold */
    --primary-hover: #b38f00;
    /* darker gold */
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    /* gray-200 */
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --input-bg: #f9fafb;
    /* gray-50 */
    --input-border: #d1d5db;
    /* gray-300 */
    --error-color: #ef4444;
    --success-color: #10b981;
}

[data-theme="dark"] {
    --bg-base: #0B0B0B;
    /* madiba-black or aureus-dark */
    --text-primary: #ffffff;
    --text-muted: #9ca3af;
    /* gray-400 */
    --primary-color: #E6B800;
    /* aureus-gold */
    --primary-hover: #ffd11a;
    /* lighter gold for dark mode contrast */
    --card-bg: #1f2937;
    /* gray-800 */
    --card-border: #374151;
    /* gray-700 */
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --input-bg: #111827;
    /* gray-900 */
    --input-border: #4b5563;
    /* gray-600 */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 3rem 0;
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo img {
    height: 32px;
    width: auto;
}

.controls {
    display: flex;
    gap: 0.75rem;
}

.control-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    /* MBC uses rounded edges, not full circles usually, except buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.control-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    /* rounded-2xl */
    padding: 3.5rem;
    box-shadow: var(--card-shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Progress */
.progress-container {
    margin-bottom: 3rem;
}

.progress-text {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    height: 8px;
    /* A bit thicker */
    background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 4px;
}

.progress-container::before {
    content: '';
    display: block;
    height: 8px;
    background: var(--card-border);
    width: 100%;
    border-radius: 4px;
    position: relative;
    top: 8px;
    z-index: -1;
}

/* Steps */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-step h2 {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-step h2::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Inputs */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    /* Classic rounded-lg */
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.15);
    /* madiba-red focus ring */
    background: var(--card-bg);
}

/* Solid labels instead of floating for a more form-like corporate feel, 
   but we'll adjust the floating logic to sit above the input instead of overlapping */
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    position: static;
    /* Removing absolute floating */
    pointer-events: auto;
}

/* Adjust the old floating classes that were applied in HTML */
.input-group label.static-label,
input:focus~label,
input:not(:placeholder-shown)~label,
textarea:focus~label,
textarea:not(:placeholder-shown)~label {
    /* Override floating to keep it static above */
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Because the HTML puts label AFTER input, we need to order it visually. 
   Using flex-col-reverse ensures the label comes first. */
.input-group {
    display: flex;
    flex-direction: column-reverse;
}

/* Checkboxes & Radios */
.choice-group {
    margin-bottom: 2rem;
    background: var(--input-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
}

.choice-label {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.checkbox-container,
.radio-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.checkbox-container input,
.radio-container input {
    margin-right: 0.75rem;
    accent-color: var(--primary-color);
    width: 1.1rem;
    height: 1.1rem;
}

.checkbox-container:hover,
.radio-container:hover {
    color: var(--text-primary);
}

/* Buttons */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary,
.btn-glow {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.btn-primary:hover,
.btn-glow:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--input-bg);
    border-color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

#loading-overlay p {
    color: white;
    font-weight: 500;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#form-message {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 500;
}

.msg-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.msg-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@media (max-width: 768px) {
    .glass-panel {
        padding: 2rem 1.5rem;
    }

    .form-header h1 {
        font-size: 1.75rem;
    }
    
    .logo img {
        height: 24px;
    }
}

/* Background Dev Animations */
.bg-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.code-symbol {
    position: absolute;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 2.5rem;
    opacity: 0.1;
    animation: float-dev 25s infinite linear;
}

[data-theme="dark"] .code-symbol {
    opacity: 0.25;
}

.symbol-1 {
    top: 15%;
    left: 10%;
    font-size: 3rem;
    animation-duration: 35s;
}

.symbol-2 {
    top: 25%;
    left: 85%;
    font-size: 4rem;
    animation-duration: 40s;
    animation-direction: reverse;
}

.symbol-3 {
    top: 75%;
    left: 15%;
    font-size: 2.5rem;
    animation-duration: 30s;
}

.symbol-4 {
    top: 85%;
    left: 80%;
    font-size: 3.5rem;
    animation-duration: 45s;
    animation-direction: reverse;
}

.symbol-5 {
    top: 45%;
    left: 5%;
    font-size: 2rem;
    animation-duration: 25s;
}

.symbol-6 {
    top: 55%;
    left: 90%;
    font-size: 2.8rem;
    animation-duration: 38s;
}

.symbol-7 {
    top: 90%;
    left: 50%;
    font-size: 4.5rem;
    animation-duration: 50s;
}

@keyframes float-dev {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-40px) rotate(180deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}