:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #c1272d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --gold-color: #ffd700;
    --marathi-orange: #ff9933;
    --cultural-red: #cc0000;
}

body {
    /* Use a static gradient instead of an animated one to eliminate continuous repaints */
    background: linear-gradient(135deg, #fff5ee 0%, #ffe4e1 25%, #ffefd5 50%, #fff8dc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Removed fixed background to eliminate repaint on scroll */
body::before {
    display: none;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    position: relative;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.row-equal-height {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.row-equal-height>[class*='col-'] {
    display: flex;
    flex-direction: column;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* Simplified shadow */
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><polygon points="30 5 35 20 50 20 40 30 45 45 30 35 15 45 20 30 10 20 25 20"/></g></svg>') repeat;
    opacity: 0.3;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    background: var(--gold-color);
    border-radius: 50%;
    opacity: 0.1;
    animation: pulse 3s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 1rem 3rem 1rem 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 3px 5px 6px rgba(0, 0, 0);
}

.brand-title::after {
    content: '🕉';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0.7;
    z-index: 3;
}

.brand-logo {
    text-align: center;
    background: #FFF5EE;
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.hero-section .brand-logo {
    position: absolute;
    top: 20px;
    left: 32px;
    z-index: 3;
    text-align: left;
}

.brand-logo img {
    max-height: 131px;
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .brand-logo img {
        max-height: 65px;
    }
}

.mobile-brand {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 2px 4px 8px rgba(255, 107, 53, 0.2);
    position: relative;
    letter-spacing: -1px;
    font-family: 'Noto Sans Devanagari', sans-serif;
    transition: all 0.3s ease;
}

.mobile-brand:hover {
    transform: scale(1.02);
    text-shadow: 2px 6px 12px rgba(255, 107, 53, 0.3);
}

.brand-tagline {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.7;
    text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.25);
    opacity: 0.95;
    letter-spacing: 0.3px;
}

.cultural-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.cultural-badges .badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 240, 0.9) 100%) !important;
    color: #c2410c !important;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(251, 146, 60, 0.3);
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cultural-badges .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.25), 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 237, 213, 0.95) 100%) !important;
    border-color: rgba(251, 146, 60, 0.5);
}

.login-form-container {
    background: #ffffff;
    padding: 3rem;
    border-radius: 28px;
    /* Simplified shadow */
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
    /* Hint for the browser */
    will-change: transform, box-shadow;
}

.login-form-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    /* Removed animation to save resources */
}

/* Simplified moveGradient to be more efficient */
@keyframes moveGradient {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(-5%, -5%, 0);
    }
}

.login-form-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-form-container:hover::before {
    opacity: 0;
}

.login-form-container:hover {
    box-shadow: 0 30px 60px rgba(255, 107, 53, 0.2);
    transform: translateY(-5px);
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.form-control {
    height: 55px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding-left: 20px;
    margin-bottom: 1.5rem;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1), transform 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--marathi-orange);
    box-shadow: 0 0 0 4px rgba(255, 153, 51, 0.15);
    background: rgba(255, 255, 255, 1);
    outline: none;
}

.input-group-premium {
    position: relative;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.input-group-premium i {
    color: #6c757d !important;
    transition: all 0.3s ease;
}

.input-group-premium:focus-within i {
    color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.form-control.is-invalid {
    border-color: var(--error-color);
    background: rgba(220, 53, 69, 0.1);
    padding-right: 20px;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.4rem rgba(220, 53, 69, 0.15);
}

.invalid-feedback {
    position: absolute;
    margin-top: -1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.mb-3.position-relative {
    margin-bottom: 1.5rem !important;
}

.ps-5 {
    padding-left: 3.5rem !important;
}

.position-relative .text-muted i {
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.position-relative .text-primary i {
    color: var(--primary-color) !important;
    transform: scale(1.1);
}

.password-toggle {
    transition: all 0.3s ease;
}

.password-toggle-btn {
    cursor: pointer;
}

.mobile-logo-container {
    min-height: 5vh;
}

.password-toggle:hover {
    color: var(--primary-color) !important;
    transform: scale(1.1);
}

.form-check-input {
    border-color: #adb5bd;
    border-width: 2px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.4rem rgba(255, 107, 53, 0.15);
}

.btn-login,
.btn-register {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    height: 55px;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 8px 16px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before,
.btn-register::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before,
.btn-register:hover::before {
    left: 100%;
}

.btn-login:hover {
    background: linear-gradient(45deg, #e55a2b, #df7f1a);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(255, 107, 53, 0.4);
}

.btn-register {
    background: linear-gradient(45deg, var(--accent-color), var(--cultural-red));
    box-shadow: 0 8px 16px rgba(204, 0, 0, 0.3);
}

.btn-register:hover {
    background: linear-gradient(45deg, #b5222a, #a00000);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(204, 0, 0, 0.4);
}

.btn-login-light,
.btn-register-premium {
    height: 48px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

/* Login Button - Light Orange */
.btn-login-light {
    background: #fff3e6;
    color: #cc5500;
    border: 1px solid #ffd9b3;
}

.btn-login-light:hover {
    background: #ffe8d6;
    transform: translateY(-1px);
}

/* Register Button - Gradient */
.btn-register-premium {
    background: linear-gradient(135deg, #ff7a18, #ff4d4d);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-register-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

/* Offer Text */
.offer-text-premium {
    text-align: center;
    font-size: 12px;
    color: #b45309;
    margin-top: 8px;
}

/* Hide old offer box styles */
.offer-box-clean {
    display: none;
}

.forgot-password {
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-color);
}

.forgot-password:hover::after {
    width: 100%;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 2px solid #dee2e6;
}

.divider-text {
    padding: 0 15px;
    color: #6c757d;
    font-size: 1rem;
    font-weight: 600;
    background: white;
}

.mobile-form-title {
    font-size: 1.5rem;
    margin-top: 0;
    background: none;
    -webkit-text-fill-color: initial;
    color: #555;
}

.mobile-divider-text {
    background: transparent;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
.password-toggle:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading state for button */
.btn-loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading .btn-text {
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Cultural elements */
.mandala-decoration {
    position: absolute;
    top: 15px;
    left: 32px;
    width: 180px;
    height: 180px;
    background: url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="45" fill="none" stroke="%23ff9933" stroke-width="2" opacity="0.3"/><circle cx="50" cy="50" r="30" fill="none" stroke="%23f7931e" stroke-width="2" opacity="0.4"/><circle cx="50" cy="50" r="15" fill="none" stroke="%23c1272d" stroke-width="2" opacity="0.5"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes rotate_slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.mandala-mobile {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="45" fill="none" stroke="%23ff9933" stroke-width="1" opacity="0.2"/><path d="M50 5 L55 45 L95 50 L55 55 L50 95 L45 55 L5 50 L45 45 Z" fill="%23ff9933" opacity="0.1"/><circle cx="50" cy="50" r="10" fill="%23ff9933" opacity="0.2"/></svg>');
    background-size: contain;
    /* Removed rotation animation for performance */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    will-change: transform;
}

.mandala-mobile i {
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.8;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

footer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 238, 0.95) 100%);
    border-top: 2px solid rgba(255, 107, 53, 0.1);
    margin-top: auto;
    position: relative;
    /* Optimize off-screen rendering */
    content-visibility: auto;
    contain-intrinsic-size: 1px 100px;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 991.98px) {
    .hero-section {
        height: 350px;
        margin-bottom: 2rem;
        border-radius: 15px;
    }

    .brand-title {
        font-size: 2.5rem;
    }

    .mobile-brand {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .brand-tagline {
        font-size: 1.3rem;
    }

    .login-form-container {
        padding: 2.5rem;
        height: auto;
        margin-bottom: 2rem;
        border-radius: 15px;
    }

    .row-equal-height {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        height: 300px;
    }

    .hero-content {
        padding: 2rem;
    }

    .brand-title {
        font-size: 2.2rem;
    }

    .cultural-badges {
        justify-content: center;
    }

    .cultural-badges .badge {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 575.98px) {
    body {
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: auto;
        padding: 0;
        margin: 0;
    }

    /* Ensure hero section is completely hidden on mobile */
    .hero-section,
    .hero-content,
    .col-lg-6.d-none.d-lg-block {
        display: none !important;
    }

    .main-container {
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1rem !important;
        margin: 0;
    }

    .main-container .container {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .main-container .row {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 0;
    }

    .main-container .col-lg-6 {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: auto;
        padding: 0;
    }

    .login-form-container {
        padding: 2rem 1.5rem;
        height: auto;
        min-height: auto;
        border-radius: 20px;
        margin: 0 auto;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.8);
        width: 100%;
        max-width: 380px;
    }

    .form-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
        letter-spacing: 0.5px;
    }

    .mobile-brand {
        font-size: 2.2rem;
        margin-top: 0;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .mobile-logo-container {
        min-height: auto;
        margin-bottom: 1.5rem;
    }

    .mobile-logo-container p {
        text-align: center;
        font-size: 1.2rem;
        color: #555;
    }

    .mobile-form-title {
        display: block !important;
        font-size: 1.6rem;
        color: #444;
        background: none;
        -webkit-text-fill-color: #444;
        text-align: center;
        margin-bottom: 1.5rem;
        font-weight: 700;
    }

    .mobile-form-title::after {
        content: '';
        display: block;
        width: 60px;
        height: 3px;
        background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
        margin: 0.5rem auto 0;
        border-radius: 2px;
    }

    /* Ensure desktop title is hidden on mobile */
    h2.form-title.d-none.d-lg-block {
        display: none !important;
    }

    /* Mobile button layout - stack vertically for better usability */
    .login-form-container form .row.g-2 {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .login-form-container form .row.g-2 > div {
        width: 100%;
        padding: 0;
    }

    .mobile-brand::before {
        left: -25px;
        font-size: 1rem;
    }

    /* Ensure password field has right padding for toggle button on mobile */
    .input-group-premium:has(.password-toggle) .form-control {
        padding-right: 45px !important;
    }

    .btn-login-light,
    .btn-register-premium {
        height: 50px;
        font-size: 0.95rem;
    }

    .offer-text-premium {
        font-size: 11px;
        margin-top: 8px;
    }

    .brand-title {
        font-size: 1.7rem;
    }

    .brand-tagline {
        font-size: 1rem;
    }

    .divider {
        margin: 0.8rem 0;
    }

    footer {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }

    footer .footer-links {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 0 10;
    }

    footer .list-inline-item {
        margin: 0 !important;
        display: block;
        text-align: center;
    }

    footer .list-inline-item a {
        font-size: 0.75rem;
        color: #555 !important;
        font-weight: 500;
        display: block;
        padding: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    footer .list-inline-item:not(:last-child) .mx-2 {
        display: none !important;
    }

    .copyright-text {
        font-size: 0.8rem;
        margin-top: 10px !important;
        border-top: 1px solid rgba(255, 107, 53, 0.05);
        padding-top: 8px;
    }
}

@media (max-width: 400px) {
    .login-form-container {
        margin: 0 auto;
        padding: 1.5rem 1.25rem;
    }

    .mobile-brand {
        font-size: 2.5rem;
    }

    .mobile-logo-container p {
        font-size: 1.3rem;
    }

    .form-title {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .main-container {
        padding: 0.5rem !important;
    }
}

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* High contrast mode support - using valid media queries */
@media (-ms-high-contrast: active) {
    .form-control {
        border-width: 3px;
    }

    .btn-login,
    .btn-register {
        border: 2px solid white;
    }
}

/* Inline styles moved from PHP */
.brand-website {
    opacity: 0.9;
    font-size: 1.1rem;
    font-weight: 500;
    margin-left: 260px;
    margin-top: -20px;
}

.mobile-website {
    font-size: 0.95rem;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}