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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container,
.forgot-container,
.reset-container {
    width: 100%;
    max-width: 440px;
}

.login-card,
.forgot-card,
.reset-card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 48px 40px;
    animation: slideUp 0.5s ease;
}

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

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    stroke: var(--primary-color);
}

.login-title,
.forgot-title,
.reset-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle,
.forgot-subtitle,
.reset-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--bg-secondary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input.error {
    border-color: var(--danger-color);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.toggle-password:hover svg {
    stroke: var(--text-primary);
}

.error-message {
    display: none;
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
}

.error-message.show {
    display: block;
}

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

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

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

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

.btn-login,
.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover,
.btn-submit:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn-login:disabled,
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-login.loading .spinner,
.btn-submit.loading .spinner {
    display: inline-block;
}

.btn-login.loading .btn-text,
.btn-submit.loading .btn-text {
    display: none;
}

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

.divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.divider-text {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    display: none;
    position: relative;
    padding-right: 44px;
}

.alert.show {
    display: block;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

.alert-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.back-link {
    text-align: center;
    margin-top: 24px;
}

.back-link a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-link a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.info-box {
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
}

.info-icon {
    width: 20px;
    height: 20px;
    stroke: #2563eb;
    flex-shrink: 0;
}

.info-text {
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.password-requirements {
    margin-top: 8px;
    padding: 12px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    font-size: 13px;
}

.password-requirements-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.requirement.met {
    color: var(--success-color);
}

.requirement svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card,
    .forgot-card,
    .reset-card {
        padding: 32px 24px;
    }

    .login-title,
    .forgot-title,
    .reset-title {
        font-size: 22px;
    }

    .logo {
        font-size: 24px;
    }
}
