/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #e02741;
    --primary-dark: #e02741;
    --secondary-color: #2f3542;
    --accent-color: #ff6b7a;
    --text-primary: #2f3542;
    --text-secondary: #747d8c;
    --background-dark: #1a1a1a;
    --background-card: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 30px rgba(255, 71, 87, 0.3);
    --border-radius: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --excellent-color: #6f42c1;
    --very-weak-color: #dc3545;
    --weak-color: #fd7e14;
    --fair-color: #ffc107;
    --good-color: #20c997;
    --strong-color: #28a745;
}

/* Dark theme variables */
[data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #b0b8c1;
    --background-dark: #1a1a1a;
    --background-card: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.2);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Light theme variables */
[data-theme="light"] {
    --text-primary: #2f3542;
    --text-secondary: #747d8c;
    --background-dark: #ffffff;
    --background-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* Device-aware overrides via body classes added by scripts/responsive.js */
body.mobile {
    --auth-card-padding: 1.75rem;
}

body.desktop {
    --auth-card-padding: 3rem;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2d2d2d 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
}

/* ===== AUTH CONTAINER ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-large);
    padding: var(--auth-card-padding, 3rem);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-heavy);
    position: relative;
    z-index: 10;
    animation: slideInUp 0.8s ease-out;
}

/* ===== AUTH HEADER ===== */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.logo h2 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Theme toggle button */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.theme-toggle i {
    transition: var(--transition);
}

[data-theme="light"] .theme-toggle i {
    transform: rotate(180deg);
}

/* ===== FORM STYLES ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .input-wrapper input:focus {
    background: rgba(0, 0, 0, 0.05);
}

.input-wrapper input::placeholder {
    color: var(--text-secondary);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary-color);
    background: rgba(255, 71, 87, 0.1);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

[data-theme="light"] .strength-bar {
    background: rgba(0, 0, 0, 0.1);
}

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

.strength-fill.weak {
    width: 25%;
    background: var(--error-color);
}

.strength-fill.fair {
    width: 50%;
    background: var(--warning-color);
}

.strength-fill.good {
    width: 75%;
    background: #17a2b8;
}

.strength-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== PASSWORD REQUIREMENTS ===== */
.password-requirements {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.requirement i {
    font-size: 0.6rem;
    transition: var(--transition);
}

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

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

/* ===== CHECKBOX STYLES ===== */
.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
    background: var(--glass-bg);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text,
.btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: flex;
}

/* ===== ERROR MESSAGES ===== */
.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    min-height: 1rem;
}

/* ===== AUTH FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

/* ===== BACKGROUND ANIMATIONS ===== */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

/* ===== NOTIFICATIONS ===== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    transform: translateX(100%);
    transition: var(--transition);
    animation: slideInRight 0.3s ease-out forwards;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification i {
    font-size: 1.2rem;
}

.notification.success i {
    color: var(--success-color);
}

.notification.error i {
    color: var(--error-color);
}

.notification.warning i {
    color: var(--warning-color);
}

.notification.info i {
    color: var(--primary-color);
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
    }

    .auth-card {
        padding: 2rem;
        margin: 1rem;
    }

    .auth-header h1 {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .input-wrapper input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    }

    .input-wrapper i {
        left: 0.875rem;
    }

    .toggle-password {
        right: 0.875rem;
    }

    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .forgot-password {
        align-self: flex-end;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ===== PASSWORD STRENGTH INDICATOR ===== */
.password-strength-indicator {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.strength-fill {
    height: 100%;
    transition: var(--transition);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.strength-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.strength-label {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: capitalize;
    transition: var(--transition);
}

.strength-score {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.strength-feedback {
    margin-bottom: 0.75rem;
}

.feedback-item {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.feedback-item.success {
    color: var(--success-color);
}

.feedback-item.error {
    color: var(--error-color);
}

.feedback-item.warning {
    color: var(--warning-color);
}

.feedback-item::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.strength-recommendations {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.strength-recommendations strong {
    color: var(--text-primary);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
}

.strength-recommendations ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.strength-recommendations li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.strength-recommendations li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .password-strength-indicator {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .strength-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .feedback-item {
        font-size: 0.75rem;
    }
    
    .strength-recommendations li {
        font-size: 0.75rem;
    }
}

/* Animation for strength changes */
.password-strength-indicator {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Strength level specific styles */
.strength-label[style*="#dc3545"] {
    text-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

.strength-label[style*="#fd7e14"] {
    text-shadow: 0 0 10px rgba(253, 126, 20, 0.3);
}

.strength-label[style*="#ffc107"] {
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.strength-label[style*="#20c997"] {
    text-shadow: 0 0 10px rgba(32, 201, 151, 0.3);
}

.strength-label[style*="#28a745"] {
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.strength-label[style*="#6f42c1"] {
    text-shadow: 0 0 10px rgba(111, 66, 193, 0.3);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
