@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    background-color: #0f172a; /* Slate 900 */
    color: #f1f5f9;
}

/* Background Glowing Orbs */
.bg-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
    padding: 20px;
}

/* Optional Background Image Overlay */
.bg-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/bgg2.png');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 1;
    filter: grayscale(40%) contrast(120%);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #3b82f6 0%, rgba(59, 130, 246, 0) 70%);
    top: -100px;
    left: -100px;
    animation: float-orb 15s infinite alternate ease-in-out;
}

.glow-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #d97706 0%, rgba(217, 151, 6, 0) 70%);
    bottom: -150px;
    right: -100px;
    animation: float-orb 20s infinite alternate-reverse ease-in-out;
}

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

/* Central Card Layout */
.login-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    z-index: 2;
    margin: auto;
}

.login-card {
    background: rgba(30, 41, 59, 0.65); /* Slate 800 with transparency */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 35px;
}

.brand-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a 0%, #0d9488 100%);
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
                0 0 0 2px rgba(255, 255, 255, 0.1);
}

.brand-logo-icon {
    width: 32px;
    height: 32px;
    color: #fbbf24; /* Amber Gold */
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.brand-subtitle {
    font-size: 13px;
    color: #fbbf24; /* Gold/Amber */
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Alert Notification */
.alert-box {
    background: rgba(239, 68, 68, 0.15); /* Soft Red */
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    color: #fca5a5;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slide-down 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-down {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(15, 23, 42, 0.4); /* Dark translucent background */
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-input:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Floating Labels */
.form-label {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When input has focus or value, float the label */
.form-input:focus ~ .form-label,
.form-wrapper.has-val .form-label {
    top: 0;
    left: 14px;
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    background: #182335; /* Card background color to mask border */
    padding: 2px 8px;
    border-radius: 4px;
    transform: translateY(-50%);
}

.form-input:focus ~ .input-icon {
    color: #3b82f6;
}

/* Captcha Layout */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.captcha-input-wrapper {
    flex: 1;
}

.captcha-label-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 158, 11, 0.1); /* Soft Amber/Gold */
    border: 1px dashed rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    padding: 12px 18px;
    min-width: 170px;
    height: 54px;
    font-size: 15px;
    font-weight: 700;
    color: #fbbf24;
    user-select: none;
}

.captcha-refresh-btn {
    background: transparent;
    border: none;
    color: #fbbf24;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.captcha-refresh-btn:hover {
    background: rgba(245, 158, 11, 0.2);
}

.captcha-refresh-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.5s ease;
}

.captcha-refresh-btn.spinning svg {
    transform: rotate(360deg);
}

/* Database / Financial Year Dropdown */
.select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
}

.select-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
}

.form-select {
    width: 100%;
    padding: 16px 40px 16px 48px;
    background: rgba(15, 23, 42, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.select-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.form-select option {
    background-color: #1e293b;
    color: #f8fafc;
    font-weight: 500;
    padding: 10px;
}

/* Button & Spinner Styles */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px -4px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
}

/* CSS Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin-loader 0.8s linear infinite;
    display: none;
}

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

/* Footer details */
.login-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.login-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #60a5fa;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        border-radius: 20px;
    }
    .brand-title {
        font-size: 21px;
    }
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .captcha-label-box {
        min-width: 100%;
    }
}
