:root {
    --primary: #7FA99B;
    --primary-light: #9BBDB0;
    --primary-dark: #6A8F81;
    --secondary: #C5D6CE;
    --accent: #8FB5A5;
    --light: #F0F4F2;
    --dark: #2F3E36;
    --text: #3A4A42;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f7f7f7;
    --gray-200: #e9e9e9;
    --gray-300: #d9d9d9;
    --gray-600: #777777;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --success: #4CAF50;
    --error: #f44336;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, var(--light) 0%, var(--gray-50) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.login-header {
    text-align: center;
    padding: 40px 40px 20px;
}

.logo {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 16px;
}

.login-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--gray-600);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--light);
}

.form-container {
    padding: 40px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--gray-50);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(127, 169, 155, 0.1);
    background: white;
}

/* Password Input Container */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 18px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.password-toggle i {
    pointer-events: none;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-col {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--primary);
}

.checkbox-group label {
    margin: 0;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.forgot-password-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

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

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(127, 169, 155, 0.3);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn.loading {
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.form-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.form-message.active {
    display: block;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.form-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(127, 169, 155, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    font-weight: 600;
}

.toast-notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.toast-notification i {
    font-size: 20px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

.password-requirements {
    margin-top: 10px;
    font-size: 12px;
}

.requirement {
    color: var(--gray-600);
    margin: 5px 0;
    padding-left: 20px;
    position: relative;
}

.requirement::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--error);
}

.requirement.valid::before {
    content: '✓';
    color: var(--success);
}

.strength-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition);
    border-radius: 2px;
}

.strength-fill.weak { width: 33%; background: var(--error); }
.strength-fill.medium { width: 66%; background: #ff9800; }
.strength-fill.strong { width: 100%; background: var(--success); }

.back-to-home {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-to-home:hover {
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    position: relative;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-600);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--dark);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

@media (max-width: 576px) {
    .form-container {
        padding: 30px 20px;
    }
    
    .login-header {
        padding: 30px 20px 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .toast-notification {
        left: 20px;
        right: 20px;
        top: 10px;
    }
}