/* auth-themes.css */

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    transition: opacity 0.5s ease-in-out;
}

body:not([class*="theme-"]) {
    --left-background: linear-gradient(135deg, #6a11cb, #2575fc);
    --left-before-background: #2575fc;
    --left-after-background: #6a11cb;
    --left-h1-text-shadow: 0px 0px 25px rgba(37, 117, 252, 0.5);
    --button-after-background: linear-gradient(135deg, #6a11cb, #2575fc);
    --button-hover-box-shadow: 0 6px 20px rgba(37, 117, 252, 0.4);
    --button-link-color: #2575fc;
    --button-link-border-color: #2575fc;
    --button-link-before-background: linear-gradient(135deg, #6a11cb, #2575fc);
}

/* Main Container */
.main-container.auth {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Left Side */
.auth .left {
    flex: 0.5;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 40px;
    height: 90%;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1),
                0 0 60px rgba(94, 114, 228, 0.25);
    transform: rotateY(4deg) scale(1.02);
    transition: transform 0.1s linear, box-shadow 0.4s ease, background 0.5s ease;
    backdrop-filter: blur(8px);
    transform-style: preserve-3d;
}

.auth .left:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), 0 0 60px rgba(94, 114, 228, 0.3);
}

.main-container.auth {
    perspective: 1000px;
}

.auth .left::before,
.auth .left::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    z-index: 0;
    transition: background 0.5s ease;
}

.auth .left::before {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 20%;
    animation: floatBlob 8s ease-in-out infinite;
}

.auth .left::after {
    width: 250px;
    height: 250px;
    bottom: 15%;
    right: 15%;
    animation: floatBlob 10s ease-in-out infinite reverse;
}

.auth .left h1 {
    font-family: 'Bowlby One', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 140px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    position: absolute;
    user-select: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    z-index: 2;
    transition: text-shadow 0.5s ease;
}

/* Blob animation */
@keyframes floatBlob {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* Right Side */
.auth .right {
    flex: 1.5;
    padding: 80px 40px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Form Styles */
.auth form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth input[type="text"],
.auth input[type="email"],
.auth input[type="password"],
.auth button {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
}

.auth button {
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    --mouse-x: 0px;
    --mouse-y: 0px;
    transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.3s ease;
    z-index: 1;
    background-color: transparent;
}

.auth button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 5px;
    opacity: 1;
    transition: opacity 0.3s ease, background 0.5s ease;
    z-index: -1;
}

.auth button:hover {
    transform: translateY(-2px);
}

.auth button::before {
    content: '';
    position: absolute;
    top: var(--mouse-y);
    left: var(--mouse-x);
    width: 200px;
    height: 200px;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 40%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth button:hover::before {
    opacity: 1;
}

/* Styling for secondary action links */
.auth .button-link {
    flex: 1;
    padding: 15px;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    background-color: transparent;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease, transform 0.2s ease, border-color 0.5s ease;
}

.auth .button-link::before {
    content: '';
    position: absolute;
    top: -2px; 
    left: -2px; 
    right: -2px; 
    bottom: -2px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.5s ease;
    z-index: -1;
}

.auth .button-link:hover {
    color: white;
    transform: translateY(-2px);
}

.auth .button-link:hover::before {
    opacity: 1;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.auth-page .switcher-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Flash Messages, etc. (common styles) */
.form-flash {
    position: absolute;
    top: 20px;
    width: 80%;
    max-width: 400px;
    background-color: #ffdddd;
    color: #a94442;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    animation: slideDownFade 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, slideUpFadeOut 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) 4s forwards;
    z-index: 10;
}

@keyframes slideUpFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */

/* Container for secondary auth links */
.auth .auth-links {
    width: 100%;
    max-width: 400px; /* Match the form width */
    display: flex;
    justify-content: space-between; /* This will push the links to either side */
    gap: 15px; /* Adds space between the buttons if they wrap */
}

/* password indicator */

.auth .password-indicator-container {
    width: 100%;
    max-width: 400px;
    height: 20px; /* Reserve space to prevent layout shift */
    margin-bottom: 5px; /* Space between indicator and button */
    text-align: center;
}

.auth .password-indicator {
    font-size: 14px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.auth .password-indicator.error {
    color: #a94442; /* A standard error red */
}

.auth .password-indicator.success {
    color: #155724; /* A standard success green */
}

.auth button:disabled,
.auth button:disabled:hover {
    color: white;
    cursor: not-allowed;
    transform: none; /* No hover effect */
    box-shadow: none;
    filter: blur(1px) brightness(1.3) saturate(0.5);
    opacity: 0.6;
}

.auth button:not(:disabled) {
    filter: blur(0px) brightness(1) saturate(1);
    opacity: 1;
}

/* password requirements checklist */

.auth #password-requirements {
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
    padding: 0 10px;
    text-align: left;
}

.auth #password-requirements ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.auth #password-requirements li {
    font-size: 13px;
    margin-bottom: 5px;
    color: #a94442; /* Default to invalid/red */
    transition: color 0.3s ease-in-out;
}

/* Style for a valid requirement */
.auth #password-requirements li.valid {
    color: #155724; /* Change to valid/green */
}

/* Adds the X or Checkmark icon before the text */
.auth #password-requirements li::before {
    content: '✖'; /* Default to X icon */
    display: inline-block;
    width: 20px;
    font-weight: bold;
}

.auth #password-requirements li.valid::before {
    content: '✓'; /* Change to Checkmark icon */
}

.social-login {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s, box-shadow 0.3s;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #555;
}

.social-button:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.social-button img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    display: none; /* Hidden by default */
}

.theme-1 .mobile-header {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    padding: 1rem;
    text-align: center;
    font-family: 'Bowlby One', sans-serif;
}

.theme-2 .mobile-header {
    background: linear-gradient(135deg, #912AEA, #fd3d8a, #f75f4c);
    color: white;
    padding: 1rem;
    text-align: center;
    font-family: 'Bowlby One', sans-serif;
}

.theme-3 .mobile-header {
    background: radial-gradient(circle at top left, #e0eaff, #f6f9ff);
    color: white;
    padding: 1rem;
    text-align: center;
    font-family: 'Bowlby One', sans-serif;
}

.mobile-header h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0px 0px 10px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    body.auth-page {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .main-container.auth {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-height: 100vh;
        padding-top: 80px; /* Account for fixed header */
        padding-bottom: 40px;
    }

    .auth .left {
        display: none;
    }

    .auth .right {
        flex: none;
        width: 100%;
        padding: 40px;
        height: auto;
    }

    .mobile-header {
        display: block;
    }
}

/* ==========================================================================
   Theme 1
   ========================================================================== */
.theme-1 .auth .left, .auth .left {
    background: var(--left-background, linear-gradient(135deg, #6a11cb, #2575fc));
}
.theme-1 .auth .left::before, .auth .left::before {
    background: var(--left-before-background, #2575fc);
}
.theme-1 .auth .left::after, .auth .left::after {
    background: var(--left-after-background, #6a11cb);
}
.theme-1 .auth .left h1, .auth .left h1 {
    text-shadow: var(--left-h1-text-shadow, 0px 0px 25px rgba(37, 117, 252, 0.5));
}
.theme-1 .auth button::after, .auth button::after {
    background: var(--button-after-background, linear-gradient(135deg, #6a11cb, #2575fc));
}
.theme-1 .auth button:hover, .auth button:hover {
    box-shadow: var(--button-hover-box-shadow, 0 6px 20px rgba(37, 117, 252, 0.4));
}
.theme-1 .auth .button-link, .auth .button-link {
    color: var(--button-link-color, #2575fc);
    border: 2px solid var(--button-link-border-color, #2575fc);
}
.theme-1 .auth .button-link:hover, .auth .button-link:hover {
    color: white;
}
.theme-1 .auth .button-link::before, .auth .button-link::before {
    background: var(--button-link-before-background, linear-gradient(135deg, #6a11cb, #2575fc));
}


/* ==========================================================================
   Theme 2
   ========================================================================== */
.theme-2 .auth .left {
    background: linear-gradient(135deg, #912AEA, #FD3D8A, #F75F4C);
}
.theme-2 .auth .left::before {
    background: #FD3D8A;
}
.theme-2 .auth .left::after {
    background: #912AEA;
}
.theme-2 .auth .left h1 {
    text-shadow: 0px 0px 25px rgba(253, 61, 138, 0.5);
}
.theme-2 .auth button::after {
    background: linear-gradient(315deg, #912AEA, #FD3D8A, #F75F4C);
}
.theme-2 .auth button:hover {
    box-shadow: 0 6px 20px rgba(247, 95, 76, 0.4);
}
.theme-2 .auth .button-link {
    color: #FD3D8A;
    border: 2px solid #FD3D8A;
}
.theme-2 .auth .button-link:hover {
    color: white;
}
.theme-2 .auth .button-link::before {
    background: linear-gradient(135deg, #FD3D8A, #F75F4C);
}


/* ==========================================================================
   Theme 3
   ========================================================================== */
.theme-3 .auth .left {
    background: radial-gradient(circle at top left, #e0eaff, #f6f9ff);
}
.theme-3 .auth .left::before {
    background: #b5cfff;
}
.theme-3 .auth .left::after {
    background: #c0ffee;
}
.theme-3 .auth .left h1 {
    text-shadow: 0px 0px 15px #b5cfff80;
}
.theme-3 .auth button {
    background: #5e72e4;
}
.theme-3 .auth button::after {
    background: linear-gradient(135deg, #5e72e4, #4e60c4);
}
.theme-3 .auth button:hover {
    box-shadow: 0 6px 20px rgba(94, 114, 228, 0.4);
}
.theme-3 .auth .button-link {
    color: #5e72e4;
    border: 2px solid #5e72e4;
}
.theme-3 .auth .button-link:hover {
    color: white;
}
.theme-3 .auth .button-link::before {
    background: linear-gradient(135deg, #5e72e4, #4e60c4);
}

/* ==========================================================================
   OTP Verification Modal
   ========================================================================== */

#modalOTP {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex; /* Changed to flex for default */
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    perspective: 1000px;
    opacity: 0; /* Start hidden */
    pointer-events: none; /* Start non-interactive */
    transition: opacity 0.4s ease;
}

#modalOTP.show {
    opacity: 1;
    pointer-events: auto;
}

.otp-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 420px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#modalOTP.show .otp-card {
    transform: scale(1);
}

.otp-header .otp-icon {
    width: 70px;
    height: 70px;
    background: var(--button-after-background, linear-gradient(135deg, #6a11cb, #2575fc));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

.otp-header .otp-icon::before {
    content: "🔑";
    font-size: 32px;
    color: white;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.otp-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.otp-subtitle {
    color: #4f4f4f;
    font-size: 1rem;
    line-height: 1.6;
}

.emailTo {
    color: var(--button-link-color, #2575fc);
    font-weight: 600;
}


.otp-form {
    margin: 25px 0 0;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}

.otp-input {
    width: 50px;
    height: 60px;
    border: none;
    border-bottom: 3px solid #ddd;
    border-radius: 8px 8px 0 0;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 4rem;
    font-weight: 700;
    color: #2c2c2c;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    outline: none;
}

.otp-input:focus {
    border-color: var(--button-link-border-color, #2575fc);
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.2);
    transform: scale(1.1);
    background: white;
}

.otp-input.error {
    border-color: #ef4444;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1.1); }
    12.5%, 50%, 87.5% { transform: translateX(-6px) scale(1.1); }
    25%, 75% { transform: translateX(6px) scale(1.1); }
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    text-align: center;
    margin: 0 0 10px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    height: 16px; /* Minimal reserved space */
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-message.show {
    opacity: 1;
}

/* Re-use existing button styles by adding the .auth class context */
.otp-form .verify-btn {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: none;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: transparent;
    transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.3s ease;
    z-index: 1;
    border-radius: 5px;
}

.otp-form .verify-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--button-after-background, linear-gradient(135deg, #6a11cb, #2575fc));
    opacity: 1;
    transition: opacity 0.3s ease, background 0.5s ease;
    z-index: -1;
    border-radius: 5px;
}

.otp-form .verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--button-hover-box-shadow, 0 6px 20px rgba(37, 117, 252, 0.4));
}

.otp-form .verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: blur(1px) brightness(1.3) saturate(0.5);
}


.resend-text {
    color: #4f4f4f;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.4s ease, color 0.3s ease;
    opacity: 0;
    pointer-events: none;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
    height: 20px; /* Fixed height to prevent modal size changes */
    display: flex;
    align-items: center;
    justify-content: center;
}

.resend-text.show {
    opacity: 1;
    pointer-events: auto;
}

.resend-text:hover {
    color: var(--button-link-color, #2575fc);
    text-decoration: underline;
}


.timer {
    font-weight: 700;
}
