/* Auth Container */
.auth-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0rem;
}

.auth-container {
    position: relative;
    z-index: 99999; /* ensure auth sits above background waves */
}

/* Ensure switchers are always clickable even on auth page */
.theme-switcher,
.lang-switcher {
    pointer-events: auto !important;
}

.theme-switcher *,
.lang-switcher * {
    pointer-events: auto !important;
}

.auth-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 1100px;
    width: 100%;
    animation: slideUp 0.5s ease;
}
/* Ensure the auth box uses a two-column grid and is responsive */
.auth-box {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    position: relative;
    z-index: 100000; /* bring auth box above other page layers */
}

/* Ensure auth box centers itself inside the page container */
.auth-box {
    margin: auto;
}

/* Ensure the auth page wrapper centers content on the viewport */
#authPage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .auth-box {
    background: rgba(30, 41, 59, 0.95);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 2rem;
    text-align: center;
    color: white;
}

/* Final.html-inspired tweaks for pixel parity */
.auth-left {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(26,26,26,0.02));
    box-sizing: border-box;
    min-height: 420px;
}

/* Prevent long translated strings from expanding the layout */
.auth-left, .auth-right {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

.auth-left h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.auth-left p { font-size: 1rem; opacity: 0.9; }

.auth-right { padding: 3rem; display:flex; flex-direction:column; justify-content:center; }
.auth-right { box-sizing: border-box; min-height: 420px; background: #fff; border-left: 1px solid rgba(0,0,0,0.04); }
.auth-right * { box-sizing: border-box; }
.auth-right .text-center img { width: 80px; height:80px; border-radius:20px; box-shadow:0 10px 30px rgba(0,0,0,0.18); }

/* Buttons inside auth should match pill shape from Final.html */
.auth-right .btn-black, .auth-right .btn-outline-black, .auth-left .btn-black {
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
}
.auth-right .btn-black { box-shadow: 0 8px 30px rgba(0,0,0,0.16); }

/* Slightly stronger shadow and rounded corners for pixel parity */
.auth-box { box-shadow: 0 30px 80px rgba(0,0,0,0.28); border-radius: 24px; }

.logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auth-header h2 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.role-card {
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: white;
}

body.dark-mode .role-card {
    background: #1e293b;
    border-color: #334155;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.role-card:hover::before {
    left: 100%;
}

.role-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.role-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
}

.role-card i {
    color: var(--primary);
    margin-bottom: 1rem;
}

.role-card h6 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

body.dark-mode .role-card h6 {
    color: #e2e8f0;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.auth-tab-button {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab-button.active {
    color: var(--primary);
}

.auth-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

body.dark-mode .form-group label {
    color: #cbd5e1;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.success-message {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* RTL Support for Auth Page */
body[dir="rtl"] .auth-box {
    direction: rtl;
}

body[dir="rtl"] .auth-right {
    border-left: none;
    border-right: 1px solid rgba(0,0,0,0.04);
}

body[dir="rtl"] .auth-left {
    border-right: none;
    border-left: 1px solid rgba(0,0,0,0.04);
}

body[dir="rtl"] .form-control {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] .form-label {
    text-align: right;
}

body[dir="rtl"] .nav-pills {
    direction: rtl;
}

body[dir="rtl"] .nav-pills .nav-item {
    direction: rtl;
}

body[dir="rtl"] .btn-black i,
body[dir="rtl"] .btn-outline-black i {
    margin-right: 0;
    margin-left: 0.5rem;
}

body[dir="rtl"] .role-card {
    text-align: center;
}

body[dir="rtl"] .text-center {
    text-align: center !important;
}

/* Responsive: stack columns on smaller viewports so both sides are visible */
@media (max-width: 900px) {
    .auth-box {
        grid-template-columns: 1fr !important;
        width: calc(100% - 32px) !important;
    }
    .auth-left, .auth-right {
        padding: 2rem !important;
    }
    .auth-left { border-radius: 20px 20px 0 0 !important; }
    .auth-right { border-radius: 0 0 20px 20px !important; }
    
    body[dir="rtl"] .auth-left { 
        border-radius: 0 0 20px 20px !important; 
        order: 2;
    }
    body[dir="rtl"] .auth-right { 
        border-radius: 20px 20px 0 0 !important; 
        order: 1;
    }
}

@media (max-width: 480px) {
    .auth-box { padding: 0; margin: 0 8px; }
}
