/* Combined Login Page Styles */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 25px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(20px);
    margin: 10px;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #4361ee, #7209b7, #f72585);
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #4361ee, #7209b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.auth-header h1 i {
    font-size: 1rem;
    background: linear-gradient(135deg, #4361ee, #7209b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

/* Login Tabs */
.login-tabs {
    display: flex;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.5rem;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c757d;
    font-family: 'Poppins', sans-serif;
    min-height: 44px; /* Better touch targets */
}

.tab-btn:hover {
    background: rgba(67, 97, 238, 0.1);
    color: #4361ee;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.tab-btn i {
    font-size: 1rem;
}

/* Login Forms */
.login-form {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.login-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-error {
    background: linear-gradient(135deg, #ffeaea, #ffcccc);
    border-left-color: #e74c3c;
    color: #c0392b;
    box-shadow: 0 3px 12px rgba(231, 76, 60, 0.15);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    animation: fadeInUp 0.5s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #2b2d42;
    font-size: 0.95rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: #4361ee;
    font-size: 1.1rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    min-height: 50px; /* Better touch targets */
    -webkit-appearance: none; /* Remove iOS shadow */
}

.input-with-icon input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 5px 18px rgba(67, 97, 238, 0.15);
    transform: translateY(-1px);
}

.input-with-icon:focus-within i {
    color: #7209b7;
    transform: scale(1.05);
}

.input-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    line-height: 1.3;
}

/* Enhanced phone input styling */
.input-with-icon input[type="tel"] {
    letter-spacing: 0.3px;
}

.btn {
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    animation-delay: 0.3s;
    min-height: 52px; /* Better touch targets */
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: white;
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7209b7, #f72585);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(114, 9, 183, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading state for button */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Extra Small Mobile Devices (320px - 375px) */
@media (max-width: 375px) {
    .auth-page {
        padding: 15px 10px;
        min-height: 100dvh; /* Use dynamic viewport height */
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .auth-card {
        padding: 25px 20px;
        border-radius: 18px;
        margin: 5px;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
        gap: 10px;
        flex-direction: column;
    }
    
    .auth-header h1 i {
        font-size: 1.6rem;
    }
    
    .auth-header p {
        font-size: 0.95rem;
    }
    
    .login-tabs {
        border-radius: 10px;
        margin-bottom: 1.2rem;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        min-height: 42px;
        gap: 6px;
        flex-direction: column;
    }
    
    .tab-btn i {
        font-size: 0.9rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .input-with-icon input {
        padding: 12px 14px 12px 42px;
        font-size: 0.95rem;
        min-height: 46px;
    }
    
    .input-with-icon i {
        left: 14px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 14px;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    .alert {
        padding: 10px 14px;
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }
    
    .input-hint {
        font-size: 0.7rem;
    }
}

/* Small Mobile Devices (376px - 480px) */
@media (min-width: 376px) and (max-width: 480px) {
    .auth-card {
        padding: 28px 22px;
    }
    
    .auth-header h1 {
        font-size: 1.7rem;
    }
    
    .tab-btn {
        padding: 11px 14px;
        font-size: 0.88rem;
    }
}

/* Tablet Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .auth-container {
        max-width: 400px;
    }
    
    .auth-card {
        padding: 35px 30px;
    }
    
    .auth-header h1 {
        font-size: 1.9rem;
    }
    
    .tab-btn {
        padding: 13px 18px;
        font-size: 0.95rem;
    }
}

/* Large Devices (769px and above) */
@media (min-width: 769px) {
    .auth-container {
        max-width: 420px;
    }
    
    .auth-card {
        padding: 40px 35px;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
}

/* Very Small Devices (below 320px) */
@media (max-width: 320px) {
    .auth-page {
        padding: 10px 8px;
    }
    
    .auth-card {
        padding: 20px 15px;
        border-radius: 16px;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
        gap: 8px;
    }
    
    .auth-header h1 i {
        font-size: 1.4rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .tab-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .input-with-icon input {
        padding: 10px 12px 10px 40px;
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 12px;
        font-size: 0.9rem;
        min-height: 46px;
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-page {
        padding: 15px 10px;
        align-items: flex-start;
        min-height: auto;
    }
    
    .auth-card {
        margin: 20px 0;
        padding: 25px 20px;
    }
    
    .auth-header {
        margin-bottom: 1rem;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .input-with-icon input {
        padding: 10px 14px 10px 42px;
        min-height: 44px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-card {
        border-width: 0.5px;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .auth-page::before,
    .auth-card::before,
    .login-form,
    .alert,
    .form-group,
    .btn,
    .tab-btn {
        animation: none;
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(43, 45, 66, 0.95);
        color: white;
    }
    
    .form-group label {
        color: rgba(255,255,255,0.9);
    }
    
    .input-with-icon input {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.2);
        color: white;
    }
    
    .input-with-icon input:focus {
        border-color: #4361ee;
        background: rgba(255,255,255,0.15);
    }
    
    .input-with-icon i {
        color: #4361ee;
    }
    
    .auth-header p {
        color: rgba(255,255,255,0.8);
    }
    
    .input-hint {
        color: rgba(255,255,255,0.7);
    }
    
    .login-tabs {
        background: rgba(67, 97, 238, 0.2);
    }
    
    .tab-btn {
        color: rgba(255,255,255,0.7);
    }
    
    .tab-btn:hover {
        background: rgba(67, 97, 238, 0.3);
        color: #4361ee;
    }
    
    .alert-error {
        background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(192, 57, 43, 0.15));
        border-left-color: #e74c3c;
        color: #ff6b6b;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .auth-page {
        min-height: -webkit-fill-available;
    }
    
    .input-with-icon input {
        font-size: 16px; /* Prevent zoom on focus */
    }
}

/* Windows High Contrast Mode */
@media (forced-colors: active) {
    .auth-card {
        border: 1px solid;
    }
    
    .tab-btn.active {
        forced-color-adjust: none;
    }
    
    .input-with-icon input:focus {
        outline: 2px solid;
    }
}