/* ============================================================
   TVL Project TRACE — Login Page Stylesheet
   ============================================================ */

/* ---------- Full-page Background ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b4aa2 0%, #062d61 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Animated background pattern */
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* Decorative floating circles */
.login-bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.login-bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -80px;
    left: -80px;
    animation: float 8s ease-in-out infinite;
}

.login-bg-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -60px;
    right: -60px;
    animation: float 10s ease-in-out infinite 2s;
}

.login-bg-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 40%;
    right: 10%;
    animation: float 7s ease-in-out infinite 1s;
}

.login-bg-circle:nth-child(4) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 15%;
    animation: float 9s ease-in-out infinite 3s;
}

.login-bg-circle:nth-child(5) {
    width: 180px;
    height: 180px;
    top: 15%;
    left: 60%;
    animation: float 11s ease-in-out infinite 0.5s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

/* ---------- Login Card ---------- */
.login-card {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 40px 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: cardFadeIn 0.6s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Logo Container ---------- */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b4aa2 0%, #1a6fd4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 8px 24px rgba(11, 74, 162, 0.3);
}

.logo-placeholder i {
    font-size: 2rem;
    color: #fff;
}

.logo-placeholder img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 6px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ---------- Login Form ---------- */
.login-form {
    margin-top: 28px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
    display: block;
}

.login-form .input-group-icon {
    position: relative;
}

.login-form .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.95rem;
    z-index: 2;
    pointer-events: none;
    transition: color 0.2s;
}

.login-form .form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #374151;
    background: #f9fafb;
    transition: all 0.25s ease;
    outline: none;
}

.login-form .form-control:focus {
    border-color: #0b4aa2;
    box-shadow: 0 0 0 3px rgba(11, 74, 162, 0.12);
    background: #fff;
}

.login-form .form-control:focus + .input-icon,
.login-form .form-control:focus ~ .input-icon {
    color: #0b4aa2;
}

.login-form .form-control::placeholder {
    color: #9ca3af;
}

/* Password toggle */
.login-form .password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px;
    z-index: 2;
    transition: color 0.2s;
}

.login-form .password-toggle:hover {
    color: #6b7280;
}

/* Remember me / Forgot */
.login-form .form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.login-form .form-check {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-form .form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #0b4aa2;
}

.login-form .form-check-label {
    font-size: 0.8rem;
    color: #6b7280;
    cursor: pointer;
}

.login-form .forgot-link {
    font-size: 0.8rem;
    color: #0b4aa2;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.login-form .forgot-link:hover {
    color: #083b82;
    text-decoration: underline;
}

/* Invalid feedback */
.login-form .invalid-feedback {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 5px;
    display: none;
}

.login-form .form-control.is-invalid {
    border-color: #ef4444;
}

.login-form .form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Alert in card */
.login-form .login-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form .login-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.login-form .login-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* ---------- Login Button ---------- */
.btn-login {
    width: 100%;
    padding: 0;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0b4aa2 0%, #1a6fd4 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #083b82 0%, #0b4aa2 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(11, 74, 162, 0.35);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(11, 74, 162, 0.25);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Login Footer ---------- */
.login-footer {
    text-align: center;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.login-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
    color: #fff;
}

/* ---------- Card Separator ---------- */
.login-separator {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: #9ca3af;
    font-size: 0.78rem;
}

.login-separator::before,
.login-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
    .login-card {
        padding: 30px 24px;
        margin: 10px;
        border-radius: 14px;
    }

    .logo-placeholder {
        width: 68px;
        height: 68px;
    }

    .logo-placeholder i {
        font-size: 1.6rem;
    }

    .login-title {
        font-size: 1.15rem;
    }

    .login-subtitle {
        font-size: 0.8rem;
    }

    .btn-login {
        height: 44px;
        font-size: 0.88rem;
    }

    .login-bg-circle:nth-child(1) {
        width: 200px;
        height: 200px;
    }

    .login-bg-circle:nth-child(2) {
        width: 140px;
        height: 140px;
    }

    .login-bg-circle:nth-child(3),
    .login-bg-circle:nth-child(4),
    .login-bg-circle:nth-child(5) {
        display: none;
    }
}

@media (max-width: 359.98px) {
    .login-card {
        padding: 24px 18px;
    }

    .login-form .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ---------- Dark mode hint (prefers-color-scheme) ---------- */
@media (prefers-color-scheme: dark) {
    .login-page {
        background: linear-gradient(135deg, #061f4a 0%, #020e24 100%);
    }
}
