* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 80vh;
}

.form-container {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.error-item:last-child {
    margin-bottom: 0;
}

.registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.form-group label i {
    color: #667eea;
    width: 16px;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:valid {
    border-color: #28a745;
}

.input-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: -3px;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #667eea;
}

.password-strength {
    margin-top: 5px;
}

.strength-meter {
    height: 4px;
    background-color: #e1e5e9;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.8rem;
    color: #888;
}

.password-match {
    font-size: 0.8rem;
    margin-top: -3px;
}

.password-match.match {
    color: #28a745;
}

.password-match.no-match {
    color: #dc3545;
}

.checkbox-group {
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    display: block;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.info-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-content {
    text-align: center;
}

.info-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.info-content > p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.feature-item i {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 12px;
    flex-shrink: 0;
}

.feature-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.feature-item p {
    opacity: 0.9;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .info-panel {
        order: -1;
        padding: 30px;
    }
    
    .info-content h2 {
        font-size: 2rem;
    }
    
    .features {
        gap: 20px;
    }
    
    .feature-item {
        gap: 15px;
    }
    
    .feature-item i {
        font-size: 1.5rem;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .info-panel {
        padding: 20px;
    }
    
    .info-content h2 {
        font-size: 1.8rem;
    }
    
    .features {
        gap: 15px;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Password strength colors */
.strength-weak {
    background-color: #dc3545;
    width: 25%;
}

.strength-fair {
    background-color: #ffc107;
    width: 50%;
}

.strength-good {
    background-color: #17a2b8;
    width: 75%;
}

.strength-strong {
    background-color: #28a745;
    width: 100%;
}

/* Animation for form appearance */
.form-container {
    animation: slideInLeft 0.6s ease-out;
}

.info-panel {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Login page design (match page.js) */
.login-container {
    display: flex !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    direction: ltr !important; /* Force LTR layout always */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: translateZ(0) !important;
    will-change: auto !important;
}

/* Left panel */
.login-left {
    flex: 1;
    min-width: 0;
    max-width: 50%;
    background: #0A1123;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 80px 50px 60px 50px;
    padding-top: 100px;
    color: white;
    overflow: hidden;
    position: relative;
}

.login-left-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
    background: #0A1123;
    text-align: center;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 400;
    margin-bottom: 20px;
    line-height: 1.15;
    text-align: center;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    word-wrap: break-word;
    transform: translateZ(0);
    will-change: auto;
}

.login-title .highlight {
    color: #6366f1;
    font-weight: 700;
}

.login-title .purple {
    color: #9333ea;
    font-weight: 700;
}

.login-title .normal {
    color: white;
    font-weight: 400;
}

.login-subtitle {
    font-size: clamp(14px, 1.6vw, 18px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: 0 auto;
    transform: none;
    white-space: normal;
    width: 100%;
    max-width: 100%;
}

/* Right panel */
.login-right {
    flex: 1;
    min-width: 0;
    max-width: 50%;
    background: #E3E6EA;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 600px;
    background: transparent;
    direction: ltr !important;
    text-align: left !important;
    position: relative;
    z-index: 1;
}

.login-form-header {
    margin-bottom: 2rem;
    direction: ltr !important;
    text-align: left !important;
}

.login-form-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0;
    text-align: left !important;
    direction: ltr !important;
}

.login-container .form-group {
    margin-bottom: 1.5rem;
}

.login-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #111827;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'Segoe UI', 'Inter', 'Roboto', 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;
    direction: ltr !important;
    text-align: left !important;
}

.login-container .form-group .input-wrapper {
    position: relative;
}

.login-container .form-group input {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    padding-right: 45px;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    font-size: 1rem;
    background: #FFFFFF;
    color: #111827;
    font-family: 'Segoe UI', 'Inter', 'Roboto', 'Open Sans', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.2s ease-in-out;
    box-shadow: none;
    direction: ltr !important;
    text-align: left !important;
    box-sizing: border-box;
    transform: translateZ(0);
}

.login-container .form-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: none;
}

.login-container .form-group input::placeholder {
    color: #9CA3AF;
}

.login-container .password-toggle {
    position: absolute;
    right: 12px !important;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease-in-out;
    font-size: 1rem;
}

.login-container .password-toggle:hover {
    color: #111827;
}

/* Make server-rendered alerts look like page.js error box */
.login-container .alert.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    padding: 12px 16px;
    border-radius: 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid #FECACA;
    box-shadow: none;
}

.login-container .btn-login {
    width: 100%;
    max-width: 100%;
    padding: 14px;
    background: #0A1123;
    color: #FFFFFF;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    box-shadow: none;
    box-sizing: border-box;
    transform: translateZ(0);
    position: relative; /* Needed for absolute loader spans */
    overflow: hidden;
}

.login-container .btn-login:hover {
    background: #0f1830;
}

.login-container .btn-login:active {
    transform: none;
}

.login-container .btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state (used by API/public/js/login.js) */
.login-container .btn-login.loading .btn-text {
    opacity: 0;
}

.login-container .btn-login.loading .btn-loader {
    display: block;
}

/* Loader default hidden */
.login-container .btn-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.login-container .btn-login .btn-loader {
    display: none;
}

@media (max-width: 968px) {
    .login-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
    }

    .login-left {
        padding: 60px 30px 40px 30px;
        padding-top: 80px;
        min-height: auto;
        flex: 0 0 auto;
        max-width: none;
    }

    .login-title {
        font-size: 36px;
    }

    .login-subtitle {
        font-size: clamp(14px, 3.2vw, 16px);
        transform: none;
        white-space: normal;
    }

    .login-right {
        padding: 30px 20px;
        flex: 1 0 auto;
        min-height: 400px;
        max-width: none;
    }
}
