:root {
    --modal-bg: rgba(255, 255, 255, 0.85);
    --modal-blur: blur(24px);
    --color-primary: #f1950b;
    --color-primary-hover: #e65c00;
    --color-error: #ef4444;
    --color-success: #10b981;
    --input-bg: rgba(255, 255, 255, 0.9);
}

.auth-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: var(--modal-bg);
    border-radius: 28px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255,255,255,0.8);
    width: 100%;
    max-width: 440px;
    /* FIX: Zero padding here. Padding is moved to .auth-step to stop the peeking */
    padding: 0; 
    position: relative;
    overflow: hidden; /* FIX: Hard clip the overflow */
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255,255,255,0.5);
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

/* Slide Transition Logic */
.auth-step-container {
    display: flex;
    width: 200%; /* Exactly twice the width of the modal */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.auth-step {
    gap: 1rem;
    width: 50%;
    flex-shrink: 0;
    padding: 2.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.show-step-2 .auth-step-container {
    transform: translateX(-50%);
}

/* Beautiful Inputs */
.auth-step .form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #333;
    background: var(--input-bg);
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.auth-step .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(241, 149, 11, 0.15), inset 0 2px 4px rgba(0,0,0,0.02);
    outline: none;
    background: #fff;
    transform: translateY(-1px);
}

.auth-step .form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Buttons */
.auth-step .btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(241, 149, 11, 0.3);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.auth-step .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(241, 149, 11, 0.4);
}

.auth-step .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.auth-step .btn-success:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* OTP Inputs */
.otp-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 1.8rem 0;
}

.otp-input {
    width: 48px;
    height: 56px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    background: var(--input-bg);
    transition: all 0.2s;
    color: #333;
    font-family: 'Poppins', sans-serif;
    padding: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.otp-input:focus {
    border-color: var(--color-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    outline: none;
    background: #fff;
    transform: translateY(-2px);
}

/* Typography & Layout specifics */
.auth-header-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-title {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    color: #451d00;
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.modal-error { 
    animation: shake 0.4s ease-in-out; 
}
.modal-error .form-control, .modal-error .otp-input {
    border-color: var(--color-error);
    background: #fff5f5;
}