/**
 * HVAC Community Login - Enhanced Styling
 * 
 * Updated login form styles using the harmonized framework
 * to integrate seamlessly with the Astra theme.
 * 
 * @version 3.0.0
 */

/* Login page wrapper */
.hvac-login-page {
    background: linear-gradient(135deg, var(--hvac-theme-background) 0%, var(--hvac-primary-subtle) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--hvac-spacing-6);
    position: relative;
    overflow: hidden;
}

/* Background decoration */
.hvac-login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--hvac-primary-light) 0%, transparent 70%);
    opacity: 0.3;
    animation: hvac-float 20s ease-in-out infinite;
}

@keyframes hvac-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(1deg); }
}

/* Main login container */
.hvac-login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* Login card */
.hvac-login-card {
    background-color: var(--hvac-background-white);
    border-radius: var(--hvac-radius-2xl);
    box-shadow: var(--hvac-shadow-xl);
    overflow: hidden;
    border: 1px solid var(--hvac-border);
    backdrop-filter: blur(10px);
    transition: transform var(--hvac-transition-normal);
}

.hvac-login-card:hover {
    transform: translateY(-8px);
}

/* Login header */
.hvac-login-header {
    background: linear-gradient(135deg, var(--hvac-primary) 0%, var(--hvac-primary-dark) 100%);
    color: white;
    padding: var(--hvac-spacing-8) var(--hvac-spacing-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hvac-login-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(50px, -50px);
}

.hvac-login-header h1 {
    font-size: var(--hvac-font-size-2xl);
    font-weight: var(--hvac-font-weight-bold);
    margin: 0 0 var(--hvac-spacing-2) 0;
    color: white;
}

.hvac-login-header p {
    font-size: var(--hvac-font-size-md);
    margin: 0;
    opacity: 0.9;
    color: white;
}

/* Login form */
.hvac-login-form {
    padding: var(--hvac-spacing-8) var(--hvac-spacing-6);
}

.hvac-login-form-group {
    margin-bottom: var(--hvac-spacing-6);
    position: relative;
}

.hvac-login-form-label {
    display: block;
    margin-bottom: var(--hvac-spacing-2);
    font-weight: var(--hvac-font-weight-semibold);
    color: var(--hvac-theme-text-dark);
    font-size: var(--hvac-font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hvac-login-form-input {
    width: 100%;
    padding: var(--hvac-spacing-4) var(--hvac-spacing-5);
    border: 2px solid var(--hvac-border);
    border-radius: var(--hvac-radius-lg);
    font-size: var(--hvac-font-size-md);
    font-family: var(--hvac-font-family);
    background-color: var(--hvac-background-white);
    transition: all var(--hvac-transition-fast);
    box-sizing: border-box;
}

.hvac-login-form-input:focus {
    border-color: var(--hvac-primary);
    box-shadow: 0 0 0 4px var(--hvac-primary-light);
    outline: none;
    transform: translateY(-2px);
}

.hvac-login-form-input::placeholder {
    color: var(--hvac-theme-text-light);
    font-style: italic;
}

/* Enhanced input with icon support */
.hvac-input-group {
    position: relative;
}

.hvac-input-icon {
    position: absolute;
    left: var(--hvac-spacing-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--hvac-theme-text-light);
    font-size: var(--hvac-font-size-lg);
    pointer-events: none;
    transition: color var(--hvac-transition-fast);
}

.hvac-input-group .hvac-login-form-input {
    padding-left: var(--hvac-spacing-12);
}

.hvac-input-group .hvac-login-form-input:focus + .hvac-input-icon {
    color: var(--hvac-primary);
}

/* Login button */
.hvac-login-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--hvac-primary) 0%, var(--hvac-primary-dark) 100%);
    color: white;
    border: none;
    padding: var(--hvac-spacing-4) var(--hvac-spacing-6);
    border-radius: var(--hvac-radius-lg);
    font-size: var(--hvac-font-size-lg);
    font-weight: var(--hvac-font-weight-semibold);
    font-family: var(--hvac-font-family);
    cursor: pointer;
    transition: all var(--hvac-transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hvac-spacing-2);
}

.hvac-login-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--hvac-shadow-lg);
}

.hvac-login-submit:active:not(:disabled) {
    transform: translateY(-1px);
}

.hvac-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Login submit ripple effect */
.hvac-login-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
}

.hvac-login-submit:active::before {
    width: 300px;
    height: 300px;
}

/* Remember me checkbox */
.hvac-remember-group {
    display: flex;
    align-items: center;
    gap: var(--hvac-spacing-2);
    margin-bottom: var(--hvac-spacing-6);
}

.hvac-remember-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--hvac-primary);
}

.hvac-remember-label {
    font-size: var(--hvac-font-size-sm);
    color: var(--hvac-theme-text);
    cursor: pointer;
    user-select: none;
}

/* Links */
.hvac-login-links {
    text-align: center;
    margin-top: var(--hvac-spacing-6);
    padding-top: var(--hvac-spacing-6);
    border-top: 1px solid var(--hvac-border-light);
}

.hvac-login-link {
    color: var(--hvac-primary);
    text-decoration: none;
    font-weight: var(--hvac-font-weight-medium);
    font-size: var(--hvac-font-size-sm);
    transition: color var(--hvac-transition-fast);
}

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

/* Error and success messages */
.hvac-login-message {
    margin-bottom: var(--hvac-spacing-6);
    padding: var(--hvac-spacing-4);
    border-radius: var(--hvac-radius-lg);
    font-size: var(--hvac-font-size-sm);
    font-weight: var(--hvac-font-weight-medium);
    text-align: center;
}

.hvac-login-message--error {
    background-color: var(--hvac-error-light);
    color: var(--hvac-error);
    border: 1px solid var(--hvac-error);
}

.hvac-login-message--success {
    background-color: var(--hvac-success-light);
    color: var(--hvac-success);
    border: 1px solid var(--hvac-success);
}

.hvac-login-message--info {
    background-color: var(--hvac-info-light);
    color: var(--hvac-accent);
    border: 1px solid var(--hvac-accent);
}

/* Loading state */
.hvac-login-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--hvac-spacing-2);
}

.hvac-login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: hvac-spin 1s linear infinite;
}

/* Alternative login methods */
.hvac-login-divider {
    text-align: center;
    margin: var(--hvac-spacing-6) 0;
    position: relative;
    color: var(--hvac-theme-text-light);
    font-size: var(--hvac-font-size-sm);
}

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

.hvac-login-divider span {
    background-color: var(--hvac-background-white);
    padding: 0 var(--hvac-spacing-4);
    position: relative;
    z-index: 2;
}

/* Responsive design */
@media (max-width: 640px) {
    .hvac-login-page {
        padding: var(--hvac-spacing-4);
        min-height: 100vh;
        align-items: flex-start;
        padding-top: var(--hvac-spacing-8);
    }
    
    .hvac-login-container {
        max-width: 100%;
    }
    
    .hvac-login-header,
    .hvac-login-form {
        padding: var(--hvac-spacing-6) var(--hvac-spacing-4);
    }
    
    .hvac-login-header h1 {
        font-size: var(--hvac-font-size-xl);
    }
    
    .hvac-login-form-input {
        padding: var(--hvac-spacing-3) var(--hvac-spacing-4);
        font-size: var(--hvac-font-size-md);
    }
    
    .hvac-input-group .hvac-login-form-input {
        padding-left: var(--hvac-spacing-10);
    }
    
    .hvac-login-submit {
        padding: var(--hvac-spacing-3) var(--hvac-spacing-5);
        font-size: var(--hvac-font-size-md);
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .hvac-login-page {
        padding: var(--hvac-spacing-3);
    }
    
    .hvac-login-header,
    .hvac-login-form {
        padding: var(--hvac-spacing-5) var(--hvac-spacing-3);
    }
    
    .hvac-login-header h1 {
        font-size: var(--hvac-font-size-lg);
    }
    
    .hvac-login-header p {
        font-size: var(--hvac-font-size-sm);
    }
}

/* Accessibility improvements */
.hvac-login-form-input:focus {
    outline: 2px solid var(--hvac-primary);
    outline-offset: 2px;
}

.hvac-login-submit:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hvac-login-card {
        border: 2px solid var(--hvac-theme-text-dark);
    }
    
    .hvac-login-form-input {
        border: 2px solid var(--hvac-theme-text-dark);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hvac-login-page::before {
        animation: none;
    }
    
    .hvac-login-card,
    .hvac-login-form-input,
    .hvac-login-submit {
        transition: none;
    }
    
    .hvac-login-card:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .hvac-login-page {
        background: white;
        min-height: auto;
    }
    
    .hvac-login-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .hvac-login-header {
        background: #000;
        color: white;
    }
}