/* Unified Login System Styles – uses theme.css when loaded */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    background: var(--bg-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.back-to-overview {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s, border-color 0.3s;
}
.back-to-overview:hover {
    background: rgba(255,255,255,0.35);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}

.login-container {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logout-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B6B, #ee5a52);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
    z-index: 1000;
    white-space: nowrap;
}

.admin-screen {
    overflow: visible !important;
}

.admin-screen.login-card {
    overflow: visible !important;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ee5a52, #e04a42);
}

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

.logout-icon {
    font-size: 16px;
}

.logout-text {
    font-size: 13px;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.role-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.doctor-icon {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.admin-icon {
    background: linear-gradient(135deg, #FF6B6B, #ee5a52);
    color: white;
}

.business-icon {
    background: linear-gradient(135deg, #FFA726, #ff9800);
    color: white;
}

.patient-icon {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.login-form {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    caret-color: transparent; /* Hide the blinking cursor */
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.client-emoji-container {
    display: block;
    margin: 20px 0;
    text-align: center;
}

.client-emoji {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.client-emoji:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.emoji-icon {
    font-size: 18px;
}

.plus-icon {
    font-size: 16px;
    font-weight: bold;
}

.client-text {
    font-weight: 500;
    font-size: 14px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.main-login-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-bottom: 15px;
}

.doctor-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.admin-btn {
    background: linear-gradient(135deg, #FF6B6B, #ee5a52);
    color: white;
}

.business-btn {
    background: linear-gradient(135deg, #FFA726, #ff9800);
    color: white;
}

.patient-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.login-btn.loading {
    pointer-events: none;
}

.btn-loader {
    display: none;
}

.back-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    color: #7f8c8d;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.back-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #764ba2;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    text-align: center;
}

.error-message p {
    color: #c33;
    font-size: 14px;
    margin: 0;
}

.success-message {
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    text-align: center;
}

.success-message p {
    color: #3c3;
    font-size: 14px;
    margin: 0;
}

/* Forgot Password Screen */
#forgotPasswordScreen {
    display: none !important;
    position: relative;
    z-index: 10;
}

#forgotPasswordScreen.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure initial screen is hidden when forgot password is active */
#forgotPasswordScreen.active ~ #initialScreen,
.login-container:has(#forgotPasswordScreen.active) #initialScreen,
#initialScreen.hidden-by-forgot-password {
    display: none !important;
    visibility: hidden !important;
}

/* Role-specific styling */
.role-screen {
    display: none;
}

.role-screen.active {
    display: block;
}

/* Responsive design */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .logout-btn {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .logout-icon {
        font-size: 14px;
    }
    
    .logout-text {
        font-size: 11px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .input-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Animation for role transitions */
.role-screen {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Loading animation */
.btn-loader {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
