/* ==========================================================================
   Base Variables
   ========================================================================== */
:root {
    --primary-color: #f4f4f4;
    --primary-dark: #4f46e5;
    --secondary-color: #084cb2;
    --accent-color: #ec4899;
    --text-color: #1e293b;
    --light-text: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --error-color: #ef4444;
    --success-color: #10b981;
    --transition-base: 0.3s ease;
    --border-radius: 0.875rem;
    --spacing-unit: 1rem;
}

/* ==========================================================================
   Global Styles
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--primary-color), #a855f7, var(--accent-color));
    background-size: 200% 200%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: gradientShift 20s ease-in-out infinite;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-1200%) rotate(720deg);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.mt-2 {
    margin-top: calc(var(--spacing-unit) * 2);
}

.opacity-95 {
    opacity: 0.95;
}

.transition-all {
    transition: all var(--transition-base);
}

/* ==========================================================================
   Container Styles
   ========================================================================== */
.login-container,
.otp-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ==========================================================================
   Branding Section
   ========================================================================== */
.login-branding,
.otp-branding {
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    position: relative;
    padding: 5vw;
    overflow: hidden;
}

.login-branding {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
}

.otp-branding {
    background: linear-gradient(145deg, #cccdf3, #00153d);
}

.branding::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.6;
}

.branding-content {
    position: relative;
    z-index: 2;
    max-width: 90%;
}

.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: float 12s infinite linear;
}

.branding-logo {
    max-width: clamp(300px, 20vw, 300px);
    margin: 0 auto; /* Centers horizontally */
    display: block; /* Ensures margin auto works */
    margin-bottom: calc(var(--spacing-unit) * 3);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    animation: pulse 4s infinite ease-in-out;
}


.branding-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.3;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.branding-text {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 300;
    line-height: 1.7;
    max-width: 90%;
    margin: 0 auto;
    animation: slideIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Feature List
   ========================================================================== */
.feature-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: calc(var(--spacing-unit) * 2.5);
    max-width: 100%;
}

.feature-item {
    display: flex;
    align-items: center;
    margin: 0.75rem 1rem;
    font-size: clamp(0.875rem, 2vw, 1rem);
    transition: transform var(--transition-base);
}

    .feature-item:hover {
        transform: translateX(8px);
    }

.feature-icon {
    margin-right: 0.75rem;
    background: rgba(255, 255, 255, 0.25);
    width: clamp(28px, 4vw, 32px);
    height: clamp(28px, 4vw, 32px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Form Container
   ========================================================================== */
.login-form-container,
.otp-form-container {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5vw;
    background: linear-gradient(180deg, #ffffff, var(--bg-color));
}

/* ==========================================================================
   Card Styles
   ========================================================================== */
.login-card,
.otp-card {
    width: 100%;
    max-width: clamp(360px, 80%, 480px);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: clamp(2rem, 5vw, 3rem);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

    .login-card:hover,
    .otp-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 35px rgba(0, 0, 0, 0.15);
    }

/* ==========================================================================
   Header Styles
   ========================================================================== */
.login-header,
.otp-header {
    margin-bottom: calc(var(--spacing-unit) * 2.5);
    text-align: center; /* Center-align all inner text */
}

    .login-header h1,
    .otp-header h1 {
        font-family: 'Playfair Display', serif;
        color: var(--text-color);
        font-weight: 700;
        font-size: clamp(1.75rem, 4vw, 2.25rem);
        margin-bottom: var(--spacing-unit);
    }

    .login-header p,
    .otp-header p {
        color: var(--light-text);
        font-size: clamp(0.875rem, 2vw, 1rem);
        margin: 0;
    }


/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-group {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    position: relative;
}
.form-section {
    margin-bottom: 15px; /* adjust as needed */
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    font-weight: 500;
    color: var(--text-color);
    transition: color var(--transition-base);
    padding-bottom:3px;
}

.form-control {
    width: 100%;
    padding: clamp(0.875rem, 2.5vw, 1rem) 1.25rem clamp(0.875rem, 2.5vw, 1rem) 3rem;
    font-size: clamp(0.9375rem, 2.5vw, 1rem);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    transition: border-color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

    .form-control:focus {
        border-color: var(--primary-color);
        background-color: #fff;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
        outline: none;
    }

    .form-control::placeholder {
        color: #94a3b8;
        font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
    }
.input-wrapper {
    position: relative;
}
.input-icon {
    position: absolute;
    left: 1.125rem;
    top: calc(50% + 0.25rem);
    transform: translateY(-50%);
    color: var(--light-text);
    transition: color var(--transition-base);
    width: clamp(18px, 3vw, 20px);
    height: clamp(18px, 3vw, 20px);
}
.input-wrapper .form-control {
    padding-left: 2.5rem; /* space for the icon */
    background-color: white; 
    border-radius: 10px;
    height: 44px;
}

.input-wrapper .input-icon {
    position: absolute;
    top: 35%;
    left: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #888;
    pointer-events: none;
}
.form-control:focus + .input-icon {
    color: var(--primary-color);
}

.otp-input-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.otp-input {
    width: clamp(40px, 10vw, 48px);
    height: clamp(40px, 10vw, 48px);
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.125rem);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    transition: border-color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
    font-family: 'Inter', sans-serif;
}

    .otp-input:focus {
        border-color: var(--primary-color);
        background-color: #fff;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
        outline: none;
    }


.fp-otp-input-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.fp-otp-input {
    width: clamp(40px, 10vw, 48px);
    height: clamp(40px, 10vw, 48px);
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.125rem);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    transition: border-color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
    font-family: 'Inter', sans-serif;
}

    .fp-otp-input:focus {
        border-color: var(--primary-color);
        background-color: #fff;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
        outline: none;
    }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-login,
.btn-verify {
    width: 100%;
    padding: clamp(0.9375rem, 2.5vw, 1rem) 1.25rem;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: clamp(1rem, 2.5vw, 1.0625rem);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.3);
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    touch-action: manipulation;
}

    .btn-login:hover,
    .btn-verify:hover {
        background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
        transform: translateY(-3px);
        box-shadow: 0 12px 20px rgba(99, 102, 241, 0.4);
    }

    .btn-login:focus,
    .btn-verify:focus {
        outline: 3px solid rgba(99, 102, 241, 0.5);
        outline-offset: 2px;
    }

    .btn-login::before,
    .btn-verify::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.4s ease;
    }

    .btn-login:hover::before,
    .btn-verify:hover::before {
        left: 100%;
    }

.loading-indicator {
    width: clamp(20px, 3vw, 22px);
    height: clamp(20px, 3vw, 22px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 0.75rem;
    display: none;
}

.btn-loading .loading-indicator {
    display: inline-block;
}

.btn-loading .btn-text {
    display: none;
}

/* ==========================================================================
   OTP Resend Link
   ========================================================================== */
.resend-otp {
    margin-top: calc(var(--spacing-unit) * 1.5);
}

    .resend-otp a {
        color: var(--primary-color);
        font-size: clamp(0.875rem, 2vw, 0.9375rem);
        text-decoration: none;
        font-weight: 500;
        transition: color var(--transition-base);
    }

        .resend-otp a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }

        .resend-otp a:focus {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-text {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: var(--light-text);
    margin-top: auto; /* This pushes it to the bottom in flex container */
    padding-bottom: 20px;
    text-align: center;
    line-height: 1.5;
    display: block;
}



.footer-logo {
    position: absolute;
    bottom: calc(var(--spacing-unit) * 2);
    max-width: clamp(150px, 20vw, 200px);
    opacity: 0.85;
    transition: opacity var(--transition-base);
}

    .footer-logo:hover {
        opacity: 1;
    }

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .login-container,
    .otp-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .login-branding,
    .otp-branding,
    .login-form-container,
    .otp-form-container {
        width: 100%;
        padding: 4vw;
    }

    .login-branding,
    .otp-branding {
        padding-bottom: 6rem;
    }

    .branding-logo {
        max-width: clamp(140px, 18vw, 160px);
        margin-bottom: calc(var(--spacing-unit) * 2);
    }

    .branding-title {
        font-size: clamp(1.75rem, 4.5vw, 2.25rem);
        margin-bottom: calc(var(--spacing-unit) * 1.5);
    }

    .branding-text {
        font-size: clamp(0.9375rem, 2.5vw, 1rem);
    }

    .feature-list {
        margin-top: calc(var(--spacing-unit) * 2);
    }

    .login-card,
    .otp-card {
        max-width: 90%;
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .footer-logo {
        position: relative;
        bottom: auto;
        margin-top: calc(var(--spacing-unit) * 3);
    }
}

@media (max-width: 768px) {
    .login-container,
    .otp-container {
        border-radius: 0;
    }

    .login-branding,
    .otp-branding,
    .login-form-container,
    .otp-form-container {
        padding: 3vw;
    }

    .branding-title {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .feature-item {
        margin: 0.5rem 0.75rem;
        font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
    }

    .login-card,
    .otp-card {
        padding: clamp(1.25rem, 3.5vw, 2rem);
    }

    .login-header h1,
    .otp-header h1 {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .form-control {
        padding: clamp(0.75rem, 2.5vw, 0.875rem) 1rem clamp(0.75rem, 2.5vw, 0.875rem) 2.5rem;
    }

    .input-icon {
        left: 0.875rem;
        width: clamp(16px, 3vw, 18px);
        height: clamp(16px, 3vw, 18px);
    }

    .otp-input {
        width: clamp(36px, 10vw, 44px);
        height: clamp(36px, 10vw, 44px);
        font-size: clamp(0.9375rem, 3vw, 1rem);
    }

    .btn-login,
    .btn-verify {
        padding: clamp(0.75rem, 2.5vw, 0.875rem) 1rem;
        font-size: clamp(0.9375rem, 2.5vw, 1rem);
    }
}

@media (max-width: 480px) {
    .login-branding,
    .otp-branding,
    .login-form-container,
    .otp-form-container {
        padding: 5vw 4vw;
    }

    .branding-logo {
        max-width: clamp(120px, 25vw, 140px);
    }

    .branding-title {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }

    .branding-text {
        font-size: clamp(0.875rem, 3vw, 0.9375rem);
    }

    .feature-icon {
        width: clamp(24px, 5vw, 28px);
        height: clamp(24px, 5vw, 28px);
    }

    .login-card,
    .otp-card {
        max-width: 95%;
        padding: clamp(1rem, 4vw, 1.5rem);
    }

    .login-header h1,
    .otp-header h1 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }

    .form-group {
        margin-bottom: calc(var(--spacing-unit) * 1.5);
    }

    .form-control {
        font-size: clamp(0.875rem, 3vw, 0.9375rem);
    }

    .otp-input-group {
        margin-bottom: calc(var(--spacing-unit) * 1.5);
    }

    .otp-input {
        width: clamp(32px, 12vw, 40px);
        height: clamp(32px, 12vw, 40px);
        font-size: clamp(0.875rem, 3.5vw, 0.9375rem);
    }

    .btn-login,
    .btn-verify {
        padding: clamp(0.75rem, 3vw, 0.875rem) 1rem;
        font-size: clamp(0.9375rem, 3vw, 1rem);
    }

    .resend-otp a {
        font-size: clamp(0.8125rem, 3vw, 0.875rem);
    }
    
}
