:root {
    --auth-primary: #304300;
    --auth-secondary: #87A052;
    --auth-accent: #daac18;
    --auth-bg-mesh: radial-gradient(at 0% 0%, rgba(135, 160, 82, 0.15) 0, transparent 50%), 
                    radial-gradient(at 100% 0%, rgba(48, 67, 0, 0.1) 0, transparent 50%), 
                    radial-gradient(at 100% 100%, rgba(218, 172, 24, 0.1) 0, transparent 50%), 
                    radial-gradient(at 0% 100%, rgba(135, 160, 82, 0.15) 0, transparent 50%),
                    #f8fafc;
    --auth-card-bg: rgba(255, 255, 255, 0.7);
    --auth-glass-border: rgba(255, 255, 255, 0.6);
    --auth-shadow: 0 20px 40px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --auth-radius: 32px;
    --auth-transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg-mesh);
    padding: 20px;
    position: relative;
    overflow: hidden;
    font-family: 'Tajawal', sans-serif;
}

/* Decorative Orbs */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 1;
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.orb-blue {
    width: 600px; height: 600px;
    background: var(--auth-secondary);
    top: -200px; right: -100px;
}

.orb-emerald {
    width: 500px; height: 500px;
    background: var(--auth-accent);
    bottom: -150px; left: -100px;
    animation-delay: -5s;
}

@keyframes float {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(50px, 100px) rotate(10deg); }
}

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    animation: authFadeIn 0.8s ease-out;
}

.auth-container.wide {
    max-width: 850px;
}

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

.auth-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--auth-glass-border);
    border-radius: var(--auth-radius);
    padding: 40px 50px;
    box-shadow: var(--auth-shadow);
    transition: var(--auth-transition);
}

.auth-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo-img {
    max-width: 110px;
    height: auto;
    margin-bottom: 12px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.05));
}

.auth-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--auth-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

/* Form Groups */
.auth-group {
    position: relative;
    margin-bottom: 12px;
}

.auth-label {
    display: block;
    font-weight: 700;
    color: #475569;
    margin-bottom: 3px;
    font-size: 12px;
    padding-right: 5px;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    transition: var(--auth-transition);
}

.auth-control {
    width: 100%;
    height: 52px;
    padding: 0 54px 0 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    transition: var(--auth-transition);
}

.auth-control:focus {
    outline: none;
    background: white;
    border-color: var(--auth-secondary);
    box-shadow: 0 0 0 4px rgba(135, 160, 82, 0.1);
    transform: translateY(-1px);
}

.auth-control:focus + i {
    color: var(--auth-secondary);
}

select.auth-control {
    appearance: none;
    cursor: pointer;
}

/* Action Buttons */
.auth-btn-primary {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(48, 67, 0, 0.2);
}

.auth-btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 15px 35px rgba(48, 67, 0, 0.3);
}

.auth-btn-primary:active {
    transform: translateY(0) scale(0.98);
}

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

.auth-divider {
    height: 1px;
    background: rgba(0,0,0,0.06);
    margin: 15px 0;
    position: relative;
}

.auth-footer {
    text-align: center;
}

.auth-link {
    color: var(--auth-secondary);
    font-weight: 800;
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.auth-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
    transition: var(--auth-transition);
    padding: 10px 20px;
    border-radius: 12px;
}

.auth-secondary-btn:hover {
    background: rgba(0,0,0,0.03);
    color: var(--auth-primary);
}

/* Grid Layout */
.auth-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
    justify-content: center;
}

.auth-col-6 { 
    width: 50%; 
    padding: 0 8px; 
}

.auth-col-12 { 
    width: 100%; 
    padding: 0 8px; 
}

/* Wizard Styles */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 35px;
    position: relative;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: white;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #94a3b8;
    transition: var(--auth-transition);
}

.step-item.active .step-number {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    color: white;
    box-shadow: 0 8px 16px rgba(48, 67, 0, 0.2);
    transform: translateY(-2px);
}

.step-item.completed .step-number {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
    color: white;
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    transition: var(--auth-transition);
}

.step-item.active .step-label {
    color: var(--auth-primary);
}

.auth-step {
    display: none;
    animation: stepIn 0.4s ease-out;
}

.auth-step.active {
    display: block;
}

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

.wizard-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.btn-wizard-prev {
    flex: 1;
    height: 48px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--auth-transition);
}

.btn-wizard-next, .auth-btn-primary {
    flex: 1;
    max-width: 250px;
}

.btn-wizard-prev {
    flex: 1;
    max-width: 150px;
}

/* Validation & Utilities */
.is-invalid {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.is-invalid + i {
    color: #ef4444 !important;
}

.auth-group:focus-within .auth-label {
    color: var(--auth-primary);
}

.auth-group:focus-within i {
    color: var(--auth-secondary);
}

@media (max-width: 768px) {
    .auth-col-6 { width: 100%; }
    .auth-card { padding: 30px 20px; }
    .auth-container { max-width: 100%; }
}

/* Popup Overlay Fixes */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.popup-box {
    background: white;
    max-width: 700px;
    width: 100%;
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: authFadeIn 0.4s ease-out;
}

.popup-scroll-text {
    max-height: 400px;
    overflow-y: auto;
    margin: 25px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    color: #475569;
}

.popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}
