@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

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

html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top left, #0f2c46 0%, #122d48 60%, #0e2038 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
}

body::before {
    width: 500px;
    height: 500px;
    background: rgba(32, 105, 150, 0.3);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

body::after {
    width: 400px;
    height: 400px;
    background: rgba(1, 67, 125, 0.2);
    bottom: -100px;
    right: -100px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 420px;
    padding: 50px 40px;
    background: #206996;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideIn 0.6s ease-out;
    z-index: 1;
    color: #fff;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    border: 2px solid rgba(100, 200, 255, 0.3);
    pointer-events: none;
    z-index: 0;
}

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

.trail {
    width: 40px;
    aspect-ratio: 1 / 1;
    position: absolute;
    inset: 0;
    border-radius: 50%;
    offset-path: border-box;
    offset-anchor: 100% 50%;
    pointer-events: none;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trail i {
    font-size: 40px;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.trail-1 {
    animation: trailMove 10s infinite linear;
}
.trail-1 i{
    margin-bottom: 40px;
}
.trail-2 {
    animation: trailMove 10s infinite linear; animation-delay: -5s;
}

@keyframes trailMove { to { offset-distance: 100%; } }

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    z-index: 2;
}

.login-card .input-group input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    background: #01437D !important;
    border: 1px solid rgba(100, 200, 255, 0.3) !important;
    border-radius: 12px !important;
    font-size: 15px;
    color: #fff !important;
    outline: none !important;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: none !important;
}

.input-group input::placeholder { color: rgba(255, 255, 255, 0.5); }

.login-card input:focus {
    box-shadow: none !important;
    background: rgba(1, 67, 125, 0.8) !important;
    border-color: rgba(100, 200, 255, 0.7) !important;
}

.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] { display: none; }

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input:checked + .checkmark {
    background: rgba(74, 144, 226, 0.7);
    border-color: rgba(74, 144, 226, 0.9);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 3px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.forgot-password {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    font-style: italic;
}

.forgot-password:hover {
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: #01437D;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(1, 67, 125, 0.5);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: rgba(1, 67, 125, 0.9);
    box-shadow: 0 6px 30px rgba(100, 200, 255, 0.6);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .login-card { width: 90%; padding: 40px 30px; }
}

/* === Force autofill fields to respect our blue look === */
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus,
.login-card input:-internal-autofill-selected {
    -webkit-box-shadow: 0 0 0 1000px #01437D inset !important;
    box-shadow: 0 0 0 1000px #01437D inset !important;
    -webkit-text-fill-color: #fff !important;
    border: 1px solid rgba(100, 200, 255, 0.3) !important;
    border-radius: 12px !important;
    caret-color: #fff !important;
    transition: background-color 9999s ease-in-out 0s !important;
}

/* Prevent Chrome from using its internal style again after focus */
.login-card input:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(1, 67, 125, 0.8) inset !important;
    box-shadow: 0 0 0 1000px rgba(1, 67, 125, 0.8) inset !important;
}

/* disabled button state */
.login-btn[disabled],
.login-btn:disabled {
    background:#5a708a !important;
    color:rgba(255,255,255,0.6);
    cursor:not-allowed;
    box-shadow:none;
    transform:none !important;
}

/* warning icon on button */
.login-btn.db-unavailable::before {
    position:absolute;
    left:16px;
    top:50%;
    transform:translateY(-50%);
    font-size:18px;
}

/* === yellow database warning banner === */
.db-warning {
    display:flex;
    align-items:center;
    gap:10px;
    background:rgba(255,230,0,0.15);
    border:1px solid rgba(255,230,0,0.4);
    color:#ffe97a;
    padding:12px 18px;
    border-radius:12px;
    font-size:14px;
    text-align:center;
    margin-bottom:25px;
    box-shadow:0 0 10px rgba(255,230,0,0.2);
}

.db-warning svg {
    flex-shrink:0;
    color:#ffd700;
}

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

.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1.5rem; /* adds spacing between logo, warning, and form */
}

/* Centered logo above the card */
.login-logo {
    width: 150px;
    height: auto;
    margin-bottom: 10px;
    margin-left: 25%;
    margin-right: 25%;
    filter: drop-shadow(0 0 6px rgba(100,200,255,0.3));
    animation: fadeInLogo 0.3s ease-out;
}

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

.lang-switcher {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    z-index: 5;
}

.lang-switcher a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.lang-switcher a:hover {
    color: white;
}

.lang-switcher a.active {
    color: #64C8FF;
}

.lang-switcher span {
    color: rgba(255,255,255,0.4);
}
