/* ====================================================================
   LOGIN.CSS - Main Login Page Styles
   Clean, modern authentication interface
   ==================================================================== */

/* ====================================================================
   GLOBAL STYLES
   ==================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Ensure modals are hidden by default */
.login-modal-overlay {
    display: none !important;
}

.login-modal-overlay.show {
    display: flex !important;
}

/* ====================================================================
   AUTH CONTAINER
   ==================================================================== */

.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ====================================================================
   AUTH HEADER
   ==================================================================== */

.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    position: relative;
    text-align: center;
}

.logo {
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

.logo:hover {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.logo:hover h1 {
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-header .language-selector {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 10 !important;
}

/* Make language selector text and icon white */
.auth-header .language-selector .language-selector-button {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.auth-header .language-selector .language-selector-button:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

.auth-header .language-selector.open .language-selector-button {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

.auth-header .language-selector .language-selector-button span {
    color: white !important;
}

/* Override any other language selector styling in header */
.auth-header .language-selector * {
    color: white !important;
}

/* ====================================================================
   AUTH TABS
   ==================================================================== */

.auth-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none !important;
    border: none !important;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.auth-tab:hover {
    background: #f1f5f9 !important;
    color: #475569;
    outline: none !important;
    box-shadow: none !important;
}

.auth-tab:focus {
    background: #f1f5f9 !important;
    color: #475569;
    outline: none !important;
    box-shadow: none !important;
}

.auth-tab:active {
    background: #f1f5f9 !important;
    color: #475569;
    outline: none !important;
    box-shadow: none !important;
}

.auth-tab.active {
    background: white !important;
    color: #667eea;
    outline: none !important;
    box-shadow: none !important;
}

.auth-tab.active:hover,
.auth-tab.active:focus,
.auth-tab.active:active {
    background: white !important;
    color: #667eea;
    outline: none !important;
    box-shadow: none !important;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ====================================================================
   MESSAGES
   ==================================================================== */

.error-message,
.success-message {
    padding: 1rem 2rem;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

/* ====================================================================
   AUTH FORMS
   ==================================================================== */

.auth-form {
    padding: 2rem;
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.form-group input:focus,
.form-group select:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.form-group input:active,
.form-group select:active {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Override any browser default styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
    outline: none !important;
    border: 2px solid #e5e7eb !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Remove default browser styling */
.form-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Phone input container styling */
.phone-input-container {
    display: flex;
    gap: 0.5rem;
}

.country-code-select {
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 80px;
}

.phone-number-input {
    flex: 1;
}

.phone-input-container .country-code-select,
.phone-input-container .phone-number-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.phone-input-container .country-code-select:focus,
.phone-input-container .phone-number-input:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.phone-input-container .country-code-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px;
    padding-left: 12px;
    text-align: left;
}


/* ====================================================================
   SUBMIT BUTTON
   ==================================================================== */

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-bottom: 1rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ====================================================================
   FORGOT PASSWORD LINK
   ==================================================================== */

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ====================================================================
   DEVELOPMENT LOGIN SECTION
   ==================================================================== */

.dev-login-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    padding: 24px;
    margin: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Hide demo accounts when register form is active */
.auth-form#registerForm.active ~ .dev-login-section {
    display: none;
}

.dev-login-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.dev-login-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.dev-login-header h3 {
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.dev-login-category {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.dev-login-category h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 4px solid;
}

.archimesh-category {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border-left-color: #dc2626;
}

.everstone-category {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.skyline-category {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

.greenrock-category {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
    border-left-color: #6b7280;
}

.dev-login-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.dev-login-btn {
    border: 2px solid;
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    background: none;
    font-family: inherit;
}

.dev-login-btn:hover {
    transform: translateY(-2px);
}

.dev-login-btn:active {
    transform: translateY(0px);
}

.dev-login-btn.super-admin {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-color: #b91c1c;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.dev-login-btn.super-admin:hover {
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.dev-login-btn.admin {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.dev-login-btn.admin:hover {
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.dev-login-btn.user {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border-color: #059669;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.dev-login-btn.user:hover {
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.dev-login-btn.pending {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #d97706;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.dev-login-btn.pending:hover {
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.dev-login-btn.suspended {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    border-color: #ea580c;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2);
}

.dev-login-btn.suspended:hover {
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
}

.dev-login-btn.terminated {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border-color: #dc2626;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.dev-login-btn.terminated:hover {
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.dev-login-info {
    text-align: left;
}

.dev-login-email {
    display: block;
    font-weight: 600;
    font-size: 13px;
}

.dev-login-role {
    display: block;
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.dev-login-role i {
    margin-right: 4px;
}

/* ====================================================================
   PASSWORD REQUIREMENTS
   ==================================================================== */

.password-requirements {
    margin-top: 0.5rem;
    padding: 0;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    display: none;
}

.password-requirements.show {
    opacity: 1;
    max-height: 200px;
    padding: 1rem;
    display: block;
}

.requirements-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.requirement i {
    color: #ef4444;
    font-size: 0.7rem;
}

.requirement.valid i {
    color: #10b981;
}

.requirement.valid {
    color: #059669;
}

/* ====================================================================
   SECURITY BADGE
   ==================================================================== */

.security-badge {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
}

.security-badge-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.85rem;
}

.security-icon {
    color: #10b981;
    font-size: 1.2rem;
}

/* ====================================================================
   RESPONSIVE DESIGN
   ==================================================================== */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .auth-container {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .auth-header {
        padding: 1.5rem;
    }
    
    .language-selector {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .dev-login-section {
        margin: 1rem;
        padding: 16px;
    }
    
    .dev-login-buttons {
        grid-template-columns: 1fr;
    }
    
    .security-badge {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-header {
        padding: 1rem;
    }
    
    .auth-form {
        padding: 1rem;
    }
    
    .dev-login-section {
        margin: 0.5rem;
        padding: 12px;
    }
    
    .dev-login-header h3 {
        font-size: 16px;
    }
    
    .dev-login-category h4 {
        font-size: 12px;
    }
    
    .dev-login-email {
        font-size: 11px;
    }
    
    .dev-login-role {
        font-size: 10px;
    }
}

/* ====================================================================
   ACCESSIBILITY IMPROVEMENTS
   ==================================================================== */

.auth-tab:focus,
.submit-btn:focus,
.dev-login-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-container {
        border: 2px solid #000;
    }
    
    .auth-tab.active {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-container,
    .auth-tab,
    .submit-btn,
    .dev-login-btn,
    .password-requirements {
        transition: none;
    }
}
