:root {
    --primary-color: #4bb13d;
    --secondary-color: #007dcb;
    --text-color: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --background-color: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(75, 177, 61, 0.05), rgba(0, 125, 203, 0.05));
}

.login-box {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 1000px;
    display: flex;
    overflow: hidden;
}

.login-image {
    flex: 1;
    background: linear-gradient(135deg, rgba(75, 177, 61, 0.1), rgba(0, 125, 203, 0.1));
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-image img {
    max-width: 100%;
    height: auto;
}

.login-form-container {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    margin-bottom: 30px;
    text-align: center;
}

.login-header h1 {
    color: var(--text-color);
    font-size: 32px;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--light-text);
    font-size: 16px;
}

.logo {
    margin-bottom: 25px;
    text-align: center;
}

.logo img {
    max-width: 250px;
    height: auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.phone-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.phone-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(75, 177, 61, 0.1);
}

.country-code {
    padding: 14px 18px;
    background: var(--background-color);
    color: var(--text-color);
    font-weight: 500;
    border-right: 2px solid var(--border-color);
}

.phone-input input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 177, 61, 0.2);
}

.error-message {
    color: #ff4444;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .login-box {
        flex-direction: column;
        max-width: 400px;
    }

    .login-image {
        padding: 30px;
    }

    .login-form-container {
        padding: 30px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .logo img {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }

    .login-image {
        padding: 20px;
    }

    .login-form-container {
        padding: 20px;
    }

    .logo img {
        max-width: 180px;
    }
}

/* Update the back button styles */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-button:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.back-button i {
    color: var(--text-color);
    font-size: 18px;
}

/* Add media query for mobile responsiveness */
@media (max-width: 768px) {
    .back-button {
        top: 15px;
        left: 15px;
        width: 35px;
        height: 35px;
    }
}

.password-input, .otp-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-input:focus-within, .otp-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(75, 177, 61, 0.1);
}

.password-input input, .otp-input input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.toggle-password {
    background: none;
    border: none;
    padding: 10px 15px;
    color: var(--light-text);
    cursor: pointer;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.otp-timer {
    color: var(--light-text);
    font-size: 14px;
}

.resend-otp {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.resend-otp:disabled {
    color: var(--light-text);
    cursor: not-allowed;
}

.resend-otp:not(:disabled):hover {
    color: var(--secondary-color);
}

/* Ensure smooth transitions */
#phoneSection, #passwordSection, #otpSection {
    transition: opacity 0.3s ease;
}

/* Password Setup Styles */
.password-requirements {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--light-text);
}

.password-requirements ul {
    list-style: none;
    margin-top: 5px;
    padding-left: 5px;
}

.password-requirements li {
    margin: 3px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.password-requirements li::before {
    content: '•';
    color: var(--light-text);
}

.password-requirements li.valid {
    color: var(--primary-color);
}

.password-requirements li.valid::before {
    content: '✓';
    color: var(--primary-color);
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.forgot-password-container {
    text-align: right;
    margin-top: 10px;
}

.forgot-password-container a {
    color: #4bb13d;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password-container a:hover {
    text-decoration: underline;
}

/* Authentication Loading Screen Styles */
.auth-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(75, 177, 61, 0.1), rgba(0, 125, 203, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.auth-loader-container {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 90%;
}

.auth-loader-brand {
    margin-bottom: 30px;
}

.auth-loading-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 15px;
}

.auth-loader-brand h2 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.auth-loader-brand p {
    color: var(--secondary-color);
    font-size: 16px;
    font-weight: 500;
}

.auth-loader-spinner {
    margin: 30px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(75, 177, 61, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: authSpin 1s linear infinite;
    margin: 0 auto;
}

.auth-loading-text {
    color: var(--light-text);
    font-size: 14px;
    margin-top: 20px;
    animation: authPulse 2s ease-in-out infinite;
}

@keyframes authSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes authPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@media (max-width: 768px) {
    .auth-loader-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .auth-loading-logo {
        max-width: 100px;
    }
    
    .auth-loader-brand h2 {
        font-size: 20px;
    }
    
    .auth-loader-brand p {
        font-size: 14px;
    }
    
    .spinner {
        width: 35px;
        height: 35px;
    }
}

/* Custom Admin Choice Modal */
.admin-choice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.admin-choice-overlay.show {
    opacity: 1;
    visibility: visible;
}

.admin-choice-modal {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    padding: 40px 30px 30px;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    position: relative;
}

.admin-choice-overlay.show .admin-choice-modal {
    transform: scale(1) translateY(0);
}

.admin-choice-header {
    margin-bottom: 30px;
}

.admin-choice-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.admin-choice-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.admin-choice-subtitle {
    font-size: 16px;
    color: var(--light-text);
    margin-bottom: 0;
}

.admin-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.admin-choice-btn {
    padding: 18px 24px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.admin-choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.admin-choice-btn:hover::before {
    left: 100%;
}

.admin-choice-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(75, 177, 61, 0.2);
}

.admin-choice-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(75, 177, 61, 0.3);
}

.admin-choice-btn-secondary {
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-choice-btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--secondary-color);
    box-shadow: 0 6px 20px rgba(0, 125, 203, 0.15);
    color: var(--secondary-color);
}

.admin-choice-btn i {
    font-size: 18px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .admin-choice-modal {
        margin: 20px;
        padding: 30px 20px 20px;
    }
    
    .admin-choice-title {
        font-size: 24px;
    }
    
    .admin-choice-subtitle {
        font-size: 14px;
    }
    
    .admin-choice-btn {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .admin-choice-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .admin-choice-buttons {
        gap: 12px;
    }
    
    .admin-choice-btn {
        padding: 14px 18px;
        font-size: 14px;
    }
}