:root {
    --primary: #4F46E5;
    --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --success: #10B981;
    --error: #EF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Split Layout */
.split-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left Side - Visual */
.visual-side {
    flex: 1;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.visual-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.visual-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.15) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
}

.visual-bg::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.15) 0%, transparent 60%);
    filter: blur(60px);
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 24px;
    z-index: 2;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.visual-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.visual-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Right Side - Form */
.form-side {
    flex: 1;
    background: var(--bg-card);
    display: flex;
    /* Removed justify-content: center to prevent top alignment overflow issues */
    /* align-items: center is okay if we use margin: auto on child */
    align-items: flex-start;
    /* safer to start at top */
    padding: 2rem;
    position: relative;
    z-index: 10;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    height: 100vh;
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 550px;
    display: flex;
    flex-direction: column;
    margin: auto;
    /* This centers it vertically when short, and top-aligns when tall */
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.form-header {
    margin-bottom: 2rem;
}

.form-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--text-muted);
}

/* Inputs */
.input-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.3s;
    position: relative;
    color: var(--text-muted);
}

/* Input Autofill Fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-dark) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.custom-input,
.custom-select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.custom-select {
    padding-left: 1rem;
}

.custom-input:focus,
.custom-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: rgba(79, 70, 229, 0.05);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Links */
.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.link {
    color: #818CF8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
}

.link:hover {
    color: #A5B4FC;
    text-decoration: underline;
}

/* Forms visibility */
.auth-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Segmented Control for Account Type */
.segmented-control {
    display: flex;
    background: var(--bg-dark);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border);
    position: relative;
    margin-bottom: 1.5rem;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 10px;
    margin: 0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1;
    transition: color 0.3s;
    position: relative;
    color: var(--text-muted);
}

.segmented-control label.active {
    color: white;
    font-weight: 600;
}

/* Animated Glider */
.glider {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    width: calc(50% - 7px);
    background: var(--primary);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Contact Person Card */
.contact-card {
    background: rgba(4, 8, 20, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

/* Scrollable area for long forms (Registration) */
/* Modified for dedicated page: always allow scroll on body, limit max-width */
.scrollable-page-body {
    width: 100%;
}

@media (max-width: 900px) {
    .split-container {
        flex-direction: column;
    }

    .visual-side {
        flex: 0.4;
        padding: 1.5rem;
        min-height: 250px;
    }

    .form-side {
        flex: 1;
        padding: 1.5rem;
        align-items: flex-start;
        overflow-y: visible;
        /* Let body scroll */
    }

    body {
        overflow-y: auto;
        flex-direction: column;
        height: auto;
    }

    .form-container {
        max-width: 100%;
    }
}

/* Two Column Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none;
}

.section-title {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}