/* Outfit @font-face */
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/outfit/outfit-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/outfit/outfit-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/outfit/outfit-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

/* Bootstrap Icons @font-face */
@font-face {
    font-family: 'bootstrap-icons';
    src: url('../fonts/bootstrap-icons/bootstrap-icons.woff2') format('woff2'),
         url('../fonts/bootstrap-icons/bootstrap-icons.woff') format('woff');
    font-weight: normal !important;
    font-style: normal !important;
}

:root {
    --bs-body-font-family: 'Outfit', sans-serif;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --primary-glow: rgba(59, 130, 246, 0.4);
    --bs-primary: #2563eb;
}

* {
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.text-primary {
    color: var(--bs-primary) !important;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    padding: 1.5rem 0;
    transition: all 0.4s ease;
    font-family: var(--bs-body-font-family);
    background-color: #020617; /* Darkest Navy Blue Background */
    color: #f8fafc;
}

.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
    margin: auto;
}

[data-bs-theme="light"] body {
    background-color: #f8fafc;
    color: #0f172a;
}

/* Abstract Background Elements */
.bg-shape {
    position: absolute;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.3; /* Reduced opacity for better contrast */
    border-radius: 50%;
    animation: float 15s infinite ease-in-out alternate;
}

[data-bs-theme="dark"] .bg-shape-1 { background: #2563eb; }
[data-bs-theme="light"] .bg-shape-1 { background: #2563eb; opacity: 0.1; }
.bg-shape-1 { top: -10%; left: -10%; width: 500px; height: 500px; }

[data-bs-theme="dark"] .bg-shape-2 { background: #0ea5e9; } /* Added blue accent for depth */
[data-bs-theme="light"] .bg-shape-2 { background: #3b82f6; opacity: 0.1; }
.bg-shape-2 { bottom: -10%; right: -10%; width: 600px; height: 600px; animation-delay: -7s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 60px) scale(1.1); }
}

/* Login Card */
.login-card {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: background 0.4s ease, border 0.4s ease;
    width: 100%;
}

@media (max-width: 576px) {
    body { padding: 1rem 0; }
    .login-card { border-radius: 20px; padding: 1.25rem !important; }
    .logo-box { width: 52px; height: 52px; margin-bottom: 0.75rem; border-radius: 14px; }
    h1.h2 { font-size: 1.25rem; margin-bottom: 0.25rem !important; }
    .text-secondary.small { font-size: 0.75rem; }
    .mb-5 { margin-bottom: 1.5rem !important; }
    .mb-4 { margin-bottom: 1rem !important; }
    .form-label { font-size: 0.65rem; margin-bottom: 0.25rem; }
    .form-control, .input-group-text { padding: 0.6rem 0.8rem; font-size: 0.9rem; border-radius: 12px; }
    .captcha-img { height: 42px; min-width: 120px; }
    .btn-reload { height: 42px; width: 42px; border-radius: 10px; }
    .btn-primary { padding: 0.75rem; font-size: 0.95rem; }
}

[data-bs-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px -15px rgba(37, 99, 235, 0.1);
}

[data-bs-theme="dark"] .login-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes slideUp { to { transform: translateY(0); opacity: 1; } }

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo-box {
    width: 72px;
    height: 72px;
    background: transparent;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: none;
    color: white;
    font-size: 1.8rem;
    border: none;
}

/* Form Controls */
.form-control, .input-group-text {
    border-radius: 14px;
    padding: 0.8rem 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="light"] .form-control, [data-bs-theme="light"] .input-group-text {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(37, 99, 235, 0.1);
    color: #1e3a8a;
}

[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .input-group-text {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ecfdf5;
}

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: #2563eb;
    background: rgba(255, 255, 255, 1);
}

[data-bs-theme="dark"] .input-group:focus-within .form-control,
[data-bs-theme="dark"] .input-group:focus-within .input-group-text {
    background: rgba(15, 23, 42, 0.8);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 14px;
    padding: 1rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--primary-glow);
    filter: brightness(1.1);
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 576px) {
    .theme-toggle { top: 1rem; right: 1rem; width: 36px; height: 36px; border-radius: 10px; }
}

[data-bs-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.03);
    color: #1e3a8a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

[data-bs-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    color: #ecfdf5;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.captcha-box { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.captcha-img {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 50px;
    object-fit: cover;
    min-width: 140px;
    flex: 1;
}

.btn-reload {
    height: 50px; width: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="light"] .btn-reload { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.1); }
.btn-reload:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.05); }

.input-group-text { border-right: none; }
.form-control { border-left: none; }
.alert { border-radius: 16px; border: none; }
