* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --success: #06d6a0;
    --warning: #ff9e00;
    --danger: #ef476f;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --white: #ffffff;
    
    --header-height: 60px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.04);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-container {
    width: 100%;
    max-width: 1200px;
    min-height: 700px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    overflow: hidden;
    position: relative;
}

.brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    transform: rotate(15deg);
}

.brand-panel::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    transform: rotate(-10deg);
}

.brand-content {
    position: relative;
    z-index: 2;
    color: white;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand-logo i {
    font-size: 40px;
    color: white;
}

.brand-logo span {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
}

.brand-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

.brand-description {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
    line-height: 1.6;
}

.brand-stats {
    display: flex;
    gap: 32px;
}

.brand-stat {
    display: flex;
    flex-direction: column;
}

.brand-stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.brand-stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.brand-features {
    margin-top: 48px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 15px;
}

.brand-feature i {
    font-size: 20px;
}

.brand-footer {
    position: relative;
    z-index: 2;
    font-size: 13px;
    opacity: 0.8;
}

.auth-panel {
    width: 480px;
    padding: 48px 40px;
    overflow-y: auto;
    background: var(--white);
}

@media (max-width: 1024px) {
    .brand-panel {
        display: none;
    }
    
    .auth-panel {
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
    }
}

.auth-header {
    margin-bottom: 32px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(67, 97, 238, 0.06);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-600);
}

.auth-tabs {
    display: flex;
    padding: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.auth-tabs + .auth-context {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 24px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-label span {
    font-weight: 400;
    color: var(--gray-500);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 14px;
}

.input-field {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    background: #fdfdff;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(67, 97, 238, 0.2);
    background: #ffffff;
}

.input-field.error {
    border-color: var(--danger);
}

.input-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.error-text {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--gray-600);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    height: 44px;
    border-radius: var(--radius-lg);
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 18px rgba(67, 97, 238, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.25);
}

.btn-primary i {
    font-size: 14px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--gray-500);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.btn-social {
    height: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-social:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-sm);
}

.btn-social:active {
    transform: translateY(1px);
}

.btn-social i {
    font-size: 16px;
}

.phone-input-group {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.phone-prefix {
    min-width: 80px;
    padding: 0 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    background: #fdfdff;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.otp-input {
    height: 44px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.auth-footer-text {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.6;
}

.auth-footer-text a {
    color: var(--primary);
    text-decoration: none;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    min-width: 260px;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: var(--gray-800);
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
    font-size: 13px;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.toast-success {
    background: #06d6a0;
}

.toast-error {
    background: #ef476f;
}

.toast-icon {
    font-size: 16px;
    margin-top: 2px;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 0;
}

.toast-close:hover {
    color: white;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .auth-container {
        min-height: auto;
        border-radius: var(--radius-lg);
    }
    
    .auth-panel {
        padding: 32px 20px;
    }
}

