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

:root {
    --primary-blue: #667eea;
    --secondary-purple: #7E43EE;
    --accent-mint: #a8fbd3;
    --accent-yellow: #FFD93D;
    --accent-coral: #FF6B6B;
    --bg-cream: #FFFDF7;
    --bg-light: #FAFAFA;
    --text-dark: #1a1a2e;
    --text-medium: #4a4a6a;
    --text-light: #6B7280;
    --white: #FFFFFF;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --gradient-main: linear-gradient(135deg, #7E43EE 0%, #667eea 50%, #5a9fff 100%);
    --gradient-fun: linear-gradient(180deg, #7E43EE 0%, #667eea 90%, #667eea 100%);
    --border-radius: 16px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
============================================ */
.header {
    background: var(--gradient-fun);
    padding: 1rem 2rem;
    position: relative;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    transition: transform 0.3s;
}

.logo:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.header-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lang-selector {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    cursor: pointer;
    font-family: inherit;
    border-radius: 50px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.lang-selector:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.back-btn {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border: 2px solid rgba(255,255,255,0.3);
}

.back-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Background decorations */
.main-content::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168, 251, 211, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.main-content::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================
   AUTH CONTAINER
============================================ */
.auth-container {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 950px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 550px;
    position: relative;
    z-index: 1;
}

/* ============================================
   LEFT SIDE - SELECTION
============================================ */
.auth-selection {
    background: var(--gradient-fun);
    color: white;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-selection::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.auth-selection-content {
    position: relative;
    z-index: 1;
}

.welcome-text {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    font-family: 'Poppins', sans-serif;
}

.welcome-subtitle {
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Auth tabs */
.auth-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.9rem 1rem;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    color: white;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
}

.auth-tab.active {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.auth-tab:hover:not(.active) {
    background: rgba(255,255,255,0.15);
}

/* User type selection */
.user-type-selection {
    display: none;
    gap: 1rem;
}

.user-type-selection.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

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

.user-type-btn {
    padding: 1.25rem 1.5rem;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-type-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    transform: translateX(5px);
}

.user-type-btn.selected {
    background: rgba(255,255,255,0.2);
    border-color: var(--accent-mint);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.user-type-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-type-info {
    flex: 1;
}

.user-type-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.user-type-desc {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* ============================================
   RIGHT SIDE - FORMS
============================================ */
.auth-forms {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.form-subtitle {
    color: var(--text-light);
    margin-bottom: 1.75rem;
    font-size: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    display: none;
    font-weight: 500;
}

.alert.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.alert-error {
    background: #FEE2E2;
    border: 1px solid var(--error);
    color: #991B1B;
}

.alert-success {
    background: #D1FAE5;
    border: 1px solid var(--success);
    color: #065F46;
}

/* Form elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    padding: 0.9rem 1.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    width: 100%;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: var(--text-light);
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    background: var(--white);
    padding: 0 1rem;
    position: relative;
    font-size: 0.9rem;
}

/* Social/OAuth buttons */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oauth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    background: white;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-dark);
}

.oauth-btn img {
    width: 22px;
    height: 22px;
}

.oauth-btn:hover {
    background: var(--bg-light);
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.google-btn {
    border-color: #dadce0;
}

.facebook-btn {
    background: #1877f2;
    color: white;
    border: none;
}

.facebook-btn:hover {
    background: #0f5ecf;
}

/* Links */
.forgot-password {
    text-align: center;
    margin-top: 1.25rem;
}

.forgot-password a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-password a:hover {
    color: var(--secondary-purple);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 860px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .auth-selection {
        padding: 2.5rem 2rem;
    }

    .auth-forms {
        padding: 2.5rem 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 500px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .auth-selection, .auth-forms {
        padding: 2rem 1.5rem;
    }

    .welcome-text {
        font-size: 1.75rem;
    }

    .auth-tabs {
        flex-direction: column;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .form-subtitle {
        font-size: 0.9rem;
    }
}

/* ============================================
   SMALL PHONES (max 400px)
============================================ */
@media (max-width: 400px) {
    .header {
        padding: 0.75rem;
    }
    
    .logo img {
        height: 40px;
    }
    
    .header-nav {
        gap: 0.5rem;
    }
    
    .lang-selector {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .back-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .auth-container {
        border-radius: 20px;
    }
    
    .auth-selection, .auth-forms {
        padding: 1.5rem 1.25rem;
    }
    
    .welcome-text {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .welcome-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .auth-tabs {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .auth-tab {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }
    
    .user-type-btn {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .user-type-icon {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
        border-radius: 10px;
    }
    
    .user-type-title {
        font-size: 0.9rem;
    }
    
    .user-type-desc {
        font-size: 0.8rem;
    }
    
    .form-title {
        font-size: 1.35rem;
    }
    
    .form-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .form-input {
        padding: 0.75rem 0.875rem;
        font-size: 16px; /* Prevents iOS zoom */
        border-radius: 10px;
    }
    
    .btn-primary {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .divider {
        margin: 1.25rem 0;
    }
    
    .divider span {
        font-size: 0.8rem;
    }
    
    .oauth-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-radius: 10px;
    }
    
    .oauth-btn img {
        width: 20px;
        height: 20px;
    }
    
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
}

/* ============================================
   VERY SMALL PHONES (max 360px)
============================================ */
@media (max-width: 360px) {
    .header {
        padding: 0.6rem;
    }
    
    .logo img {
        height: 36px;
    }
    
    .lang-selector {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .back-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .auth-container {
        border-radius: 16px;
    }
    
    .auth-selection, .auth-forms {
        padding: 1.25rem 1rem;
    }
    
    .welcome-text {
        font-size: 1.35rem;
    }
    
    .welcome-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .auth-tab {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .user-type-btn {
        padding: 0.875rem;
        gap: 0.6rem;
    }
    
    .user-type-icon {
        width: 38px;
        height: 38px;
        font-size: 1.35rem;
    }
    
    .user-type-title {
        font-size: 0.85rem;
    }
    
    .user-type-desc {
        font-size: 0.75rem;
    }
    
    .form-title {
        font-size: 1.2rem;
    }
    
    .form-subtitle {
        font-size: 0.8rem;
    }
    
    .form-label {
        font-size: 0.8rem;
    }
    
    .form-input {
        padding: 0.7rem 0.75rem;
    }
    
    .btn-primary {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .oauth-btn {
        padding: 0.7rem 0.875rem;
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .oauth-btn img {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   MINIMUM WIDTH (320px)
============================================ */
@media (max-width: 320px) {
    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .header-nav {
        gap: 0.35rem;
    }
    
    .logo img {
        height: 32px;
    }
    
    .lang-selector {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .back-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 0.35rem;
    }
    
    .auth-container {
        border-radius: 14px;
    }
    
    .auth-selection, .auth-forms {
        padding: 1rem 0.875rem;
    }
    
    .welcome-text {
        font-size: 1.2rem;
    }
    
    .welcome-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .auth-tabs {
        gap: 0.4rem;
        margin-bottom: 1rem;
    }
    
    .auth-tab {
        padding: 0.6rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .user-type-selection {
        gap: 0.75rem;
    }
    
    .user-type-btn {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .user-type-icon {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
        border-radius: 8px;
    }
    
    .user-type-title {
        font-size: 0.8rem;
    }
    
    .user-type-desc {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    
    .form-title {
        font-size: 1.1rem;
    }
    
    .form-subtitle {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 0.875rem;
    }
    
    .form-label {
        font-size: 0.75rem;
    }
    
    .form-input {
        padding: 0.65rem 0.7rem;
        border-radius: 8px;
    }
    
    .btn-primary {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
        border-radius: 30px;
    }
    
    .divider {
        margin: 1rem 0;
    }
    
    .divider span {
        font-size: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .social-buttons {
        gap: 0.5rem;
    }
    
    .oauth-btn {
        padding: 0.65rem 0.75rem;
        font-size: 0.75rem;
        border-radius: 8px;
        gap: 6px;
    }
    
    .oauth-btn img {
        width: 16px;
        height: 16px;
    }
    
    .forgot-password {
        margin-top: 1rem;
    }
    
    .forgot-password a {
        font-size: 0.8rem;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }
}

#loginTypeSelection { 
    display: none !important; 
}