/* Login and registration styles */

/* Theme variables */
:root {
    --cvsu-green: #2E7D1E;
    --cvsu-green-light: #3E8E2E;
    --cvsu-green-dark: #1F5F14;
    --cvsu-gold: #F2C94C;
    --sidebar-gradient-start: #3E8E2E;
    --sidebar-gradient-end: #1F5F14;
    --header-accent: #246A18;
    
    --bg-body: #f8f9fa;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --text-main: #333333;
    --text-dark: #1a1a1a;
    --text-medium: #666;
    --text-light: #6c757d;
    --border-color: #e9ecef;
    
    --color-primary: #2E7D1E;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
    
    --font-main: 'Poppins', sans-serif;
    --radius-std: 12px;
    --shadow-std: 0 4px 16px rgba(32, 96, 24, 0.1);
    --shadow-hover: 0 6px 20px rgba(32, 96, 24, 0.15);
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login container */

.login-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    background: var(--bg-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    min-height: 700px;
    height: auto;
}

/* Branding panel */

.login-brand {
    background: linear-gradient(180deg, var(--sidebar-gradient-start) 0%, var(--cvsu-green) 35%, var(--header-accent) 70%, var(--sidebar-gradient-end) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    overflow: hidden;
    flex: 1;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.brand-overlay {
    position: relative;
    z-index: 1;
    text-align: center;
}

.brand-content {
    max-width: 400px;
}

.logo-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 15px;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: 48px;
    font-weight: 900;
    color: white;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-weight: 500;
}

.brand-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    font-weight: 400;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 50px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    font-size: 14px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-item .material-symbols-outlined {
    font-size: 28px;
    color: var(--cvsu-gold);
}

/* Form container */

.login-form-container {
    padding: 60px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    flex: 1;
}

.login-form-wrapper {
    width: 100%;
    max-width: 450px;
}

.login-form-wrapper.register-form {
    max-width: 500px;
}

.form-header {
    margin-bottom: 35px;
}

.form-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--cvsu-green);
    margin-bottom: 8px;
}

.form-header p {
    font-size: 14px;
    color: var(--text-medium);
}

/* Role selection */

.role-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.role-option {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-std);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.role-option:hover {
    border-color: var(--cvsu-green-light);
    background: rgba(46, 125, 30, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(32, 96, 24, 0.15);
}

.role-option.active {
    border-color: var(--cvsu-green);
    background: rgba(46, 125, 30, 0.1);
    box-shadow: 0 4px 12px rgba(32, 96, 24, 0.2);
}

.role-option .material-symbols-outlined {
    font-size: 36px;
    color: var(--cvsu-green);
}

.role-option span:last-child {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Form styles */

.form-group {
    margin-bottom: 25px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.form-group label .material-symbols-outlined {
    font-size: 18px;
    color: var(--cvsu-green);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-std);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    background: white;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--cvsu-green);
    box-shadow: 0 0 0 4px rgba(46, 125, 30, 0.1);
}

.form-input::placeholder {
    color: #adb5bd;
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    font-size: 20px;
    transition: all 0.3s ease;
    user-select: none;
}

.password-toggle:hover {
    color: var(--cvsu-green);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-medium);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--cvsu-green);
}

.forgot-password {
    font-size: 13px;
    color: var(--cvsu-green);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--cvsu-green-dark);
    text-decoration: underline;
}

/* Terms Label */
.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-medium);
    cursor: pointer;
}

.terms-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--cvsu-green);
    flex-shrink: 0;
    margin-top: 2px;
}

.link-terms {
    color: var(--cvsu-green);
    text-decoration: none;
    font-weight: 600;
}

.link-terms:hover {
    text-decoration: underline;
}

/* Buttons */

.btn-login {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--cvsu-green) 0%, var(--cvsu-green-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-std);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(46, 125, 30, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 30, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login .material-symbols-outlined {
    font-size: 22px;
}

/* Form footer */

.form-footer {
    margin-top: 25px;
    text-align: center;
}

.form-footer p {
    font-size: 14px;
    color: var(--text-medium);
}

.link-register {
    color: var(--cvsu-green);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.link-register:hover {
    color: var(--cvsu-green-dark);
    text-decoration: underline;
}

/* Divider */

.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 15px;
}

/* Social login */

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-std);
    background: white;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dark);
}

.btn-social:hover {
    background: var(--bg-light);
    border-color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-social svg {
    flex-shrink: 0;
}

/* Responsive rules */

@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
        max-width: 600px;
    }

    .login-brand {
        display: none;
    }

    .login-form-container {
        padding: 40px 30px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 15px;
    }

    .login-container {
        border-radius: 15px;
    }

    .login-form-container {
        padding: 30px 25px;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .form-header h2 {
        font-size: 26px;
    }

    .role-selection {
        grid-template-columns: 1fr;
    }

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

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Animations */

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

.login-form-wrapper {
    animation: fadeIn 0.5s ease;
}

/* SCROLLBAR (for registration form) */

.login-form-wrapper::-webkit-scrollbar {
    width: 6px;
}

.login-form-wrapper::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.login-form-wrapper::-webkit-scrollbar-thumb {
    background: var(--cvsu-green);
    border-radius: 10px;
}

.login-form-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--cvsu-green-dark);
}

/* Validation states */

.form-input:invalid:not(:placeholder-shown) {
    border-color: var(--color-danger);
}

.form-input:valid:not(:placeholder-shown) {
    border-color: var(--color-success);
}

/* Success/Error Messages */
.alert-message {
    padding: 14px 18px;
    border-radius: var(--radius-std);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #1e7e34;
    border: 2px solid rgba(40, 167, 69, 0.3);
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333;
    border: 2px solid rgba(220, 53, 69, 0.3);
}

.alert-message .material-symbols-outlined {
    font-size: 20px;
}

/* Loading State */
.btn-login.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-login.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}