/* ==============================================
  Authentication Pages SPECIFIC Styles (V4 - Corrected)
  NOTE: General styles for forms, buttons, etc.
  are inherited from base.css
  ==============================================
*/

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f0f5fa; /* A slightly different blueish-gray */
    padding: 20px;
}

/* --- New Two-Column Layout Wrapper --- */
.auth-wrapper {
    display: flex;
    width: 100%;
    max-width: 960px; /* Wider container for the two columns */
    min-height: 650px;
    margin: 20px auto;
    background-color: var(--component-bg-color);
    border-radius: 16px; /* More rounded corners */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* --- New Branding Panel (Right Side) --- */
.auth-branding-panel {
    flex: 1 1 45%;
    background: var(--primary-color); /* Fallback color */
    background: linear-gradient(145deg, #1A73E8, #2b8b50); /* Gradient based on template colors */
    color: #fff;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Decorative circles for branding panel */
.auth-branding-panel::before,
.auth-branding-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.07);
    z-index: 1;
}
.auth-branding-panel::before {
    width: 200px;
    height: 200px;
    top: -50px;
    left: -80px;
}
.auth-branding-panel::after {
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: -120px;
}

.auth-branding-panel .branding-content {
    position: relative;
    z-index: 2;
}

.auth-branding-panel h1 {
    font-family: 'PinarBold', sans-serif;
    font-size: 2.2rem; /* Adjusted for better fit */
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-branding-panel p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
}

/* --- Form Panel (Left Side) --- */
.auth-form-panel {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* --- Main Container --- */
.auth-container {
    position: relative; /* This is crucial for the loader overlay */
    width: 100%;
    max-width: 400px;
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* --- Panel System --- */
.auth-panel {
    display: none;
    padding: 10px; /* Reduced padding as wrapper has padding now */
    animation: fadeIn 0.5s ease-in-out;
}
.auth-panel.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Header --- */
.auth-header {
    text-align: center;
    margin-bottom: 30px; /* Increased margin */
    position: relative;
}
.auth-header .logo {
    height: 45px;
    margin-bottom: 20px; /* Increased margin */
}
.auth-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}
.auth-header p {
    margin: 8px 0 0; /* Increased margin */
    color: var(--dark-gray-color);
    font-size: 15px;
}
.back-to-identifier-btn {
    position: absolute;
    top: -15px;
    right: -20px;
    background: none;
    border: none;
    color: var(--dark-gray-color);
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-identifier-btn:hover {
    background-color: var(--light-gray-color);
}

/* --- CORRECTED: Original Tabs Style --- */
.auth-tabs {
    display: flex;
    background-color: var(--light-gray-color);
    border-radius: var(--border-radius);
    padding: 5px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
    position: relative; /* Keep relative for potential pseudo-elements if needed later */
    color: var(--text-color); /* Default text color */
}
.auth-tab.active {
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
/* Remove the ::after pseudo-element from the new style */
.auth-tab.active::after {
    content: none;
}


/* --- Country Selector --- */
#mobile-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.country-selector {
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: pointer;
    height: 50px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.country-selector .name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 5px;
}
.country-selector .code {
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

/* --- Captcha --- */
.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}
.captcha-wrapper .input-wrapper {
    flex-grow: 1;
}
.captcha-image {
    background-color: #f1f3f4;
    color: var(--text-color);
    padding: 0 15px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'PinarBold', monospace;
    font-size: 22px;
    letter-spacing: 5px;
    user-select: none;
    text-decoration: none; /* Removed line-through */
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}
.captcha-refresh-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: var(--dark-gray-color);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.captcha-refresh-icon.spinning .fa-sync-alt {
    animation: spin 1s linear infinite;
}
.form-control.with-refresh-icon {
    padding-left: 45px;
}

/* --- Buttons & Links Specific to Auth Layout --- */
.auth-container .btn {
    width: 100%;
}
.btn-google {
    background-color: #fff;
    color: var(--text-color);
    border: 1px solid #ddd;
}
.btn-google:hover {
    background-color: var(--light-gray-color);
}
.btn-link {
    margin-top: 15px;
}
.form-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- OTP Panel --- */
.otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 25px 0;
}
.otp-input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: #fff;
    direction: ltr;
}
.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.resend-timer {
    text-align: center;
    margin-top: 25px;
}
.resend-timer .timer-text {
    color: var(--dark-gray-color);
    margin-bottom: 10px;
}
.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--medium-gray-color);
    border-radius: 3px;
    overflow: hidden;
}
.progress {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 1s linear;
}

/* --- Success Panel --- */
#success-panel {
    text-align: center;
    padding: 50px 35px;
}
.success-icon {
    font-size: 60px;
    color: var(--success-color);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #eafaf1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: popIn 0.5s ease;
}
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Loader Overlay --- */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.loader-overlay.show {
    display: flex;
}
.loader-overlay .spinner {
    width: 50px;
    height: 50px;
    border-width: 5px;
}

/* --- Country Popup Specific Styles --- */
.country-popup-content {
    display: flex;
    flex-direction: column;
    height: 300px;
	width: 300px;
}
.country-search-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}
.country-search-input {
    width: 100%;
    height: 45px;
    padding: 0 45px 0 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 15px;
}
.country-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}
.country-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray-color);
}
.country-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}
.country-list-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 6px;
}
.country-list-item:hover {
    background-color: var(--light-gray-color);
}
.country-list-item .name {
    flex-grow: 1;
    margin-left: 15px;
}
.country-list-item .code {
    color: var(--dark-gray-color);
    direction: ltr;
}

/* --- Responsive Design --- */
@media (max-width: 800px) {
    .auth-branding-panel {
        display: none; /* Hide branding panel on smaller screens */
    }
    .auth-form-panel {
        flex-basis: 100%;
        padding: 20px;
    }
    .auth-wrapper {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
    .auth-body {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .auth-body {
        background-color: #fff;
    }
    .auth-panel {
        padding: 20px 10px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
