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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #f43f5e;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --success-bg: #f0fdf4;
    --success-text: #15803d;
}

body.auth-body {
    font-family: 'Outfit', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../img/background.png') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    padding: 1rem;
}

body.auth-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.auth-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 520px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.brand-header {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.15) 100%);
    border-radius: 0.35rem;
    /* border: 1px solid rgba(79, 70, 229, 0.1); */
}

.brand-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand-logo-left,
.brand-logo-right {
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-title-center {
    flex: 1;
    text-align: center;
}

.brand-title-center h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.brand-title-center p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-weight: 500;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(79, 70, 229, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.alert-box {
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-box.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}

.alert-box.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon>i:first-child {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border-radius: 0.35rem;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: all 0.2s;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.toggle-pwd {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.toggle-pwd:hover {
    color: var(--primary);
}

.captcha-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.captcha-display {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0 1rem;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--primary);
    user-select: none;
}

.btn-refresh {
    width: 42px;
    height: 42px;
    border-radius: 0.35rem;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-light);
}

.captcha-wrapper input {
    flex: 1;
    height: 42px;
    border-radius: 0.35rem;
    border: 1px solid var(--border);
    padding: 0 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    min-width: 0;
}

.captcha-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.25rem 0;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    accent-color: var(--primary);
}

.forgot-pwd {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.forgot-pwd:hover {
    text-decoration: underline;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    border-radius: 0.35rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border: none;
    transition: 0.3s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.help-text {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.form-footer-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.form-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.form-footer-links a:hover {
    color: var(--primary);
}

.partners-section {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.partner-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.partner-box span {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
}

.partner-box img {
    height: 28px;
}

.copyright {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 1.5rem;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .brand-logo-left,
    .brand-logo-right {
        height: 40px;
    }

    .brand-title-center h1 {
        font-size: 1.15rem;
    }

    .brand-header-inner {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* --- NEW REFERENCE LOGIN PAGE STYLES --- */

body.ref-login-body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background: url('../img/background.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    position: relative;
}

body.ref-login-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 0;
}

.ref-main-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 2;
}

.ref-login-box {
    background: #ffffff;
    width: 100%;
    max-width: 1200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.ref-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ref-header-left img {
    height: 70px;
}

.ref-header-titles {
    display: flex;
    flex-direction: column;
}

.ref-header-titles h2 {
    font-size: 1.5rem;
    color: #881326; /* Maroon color for hindi text */
    font-weight: 700;
    margin: 0;
}

.ref-header-titles h1 {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
}

.ref-header-right {
    display: flex;
    align-items: center;
}

.ref-portal-badge {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ref-content {
    display: flex;
    padding: 2rem;
    gap: 2rem;
}

.ref-content-left {
    flex: 6;
    padding-right: 2rem;
}

.ref-content-left h3 {
    font-size: 1.4rem;
    color: #0f172a;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.ref-content-left ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

.ref-content-left ul li {
    margin-bottom: 0.5rem;
}

.ref-content-left ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.ref-divider {
    width: 2px;
    background-color: #881326;
    opacity: 0.4;
}

.ref-content-right {
    flex: 4;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ref-input-group {
    margin-bottom: 1.25rem;
}

.ref-input-group label {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.ref-input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    font-size: 0.95rem;
}

.ref-input-group input:focus {
    outline: none;
    border-color: #881326;
}

.ref-captcha-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ref-captcha-box {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    padding: 0.5rem 1rem;
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 5px;
    color: #0f172a;
}

.ref-captcha-refresh {
    background: none;
    border: none;
    color: #475569;
    font-size: 1.25rem;
    cursor: pointer;
}

.ref-login-btn {
    width: 100%;
    background-color: #881326;
    color: white;
    border: none;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.25rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.ref-login-btn:hover {
    background-color: #6a0f1d;
}

/* --- COMMON FOOTER FOR BOTH PAGES --- */
.maroon-footer {
    background-color: #881326;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.maroon-footer-social {
    display: flex;
    gap: 1rem;
}

.maroon-footer-social i {
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.maroon-footer-social i:hover {
    opacity: 0.7;
}

@media (max-width: 992px) {
    .ref-content {
        flex-direction: column;
    }
    .ref-divider {
        width: 100%;
        height: 2px;
        margin: 1rem 0;
    }
    .ref-content-left {
        padding-right: 0;
    }
    .ref-content-right {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .ref-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .ref-header-left {
        flex-direction: column;
    }
    .maroon-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}