/* ============================================
   E-OFFICE LOGIN — Modern Premium Design
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

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

/* ===== Body & Background ===== */
body {
    background-image: url("../img/bg.jpg");
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    font-family:
        "Inter",
        "Poppins",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Dark overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(15, 23, 42, 0.4) 0%,
        rgba(15, 23, 42, 0.15) 50%,
        rgba(15, 23, 42, 0.05) 100%
    );
    z-index: 0;
}

/* Subtle animated noise/grain */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== Container Override ===== */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
    max-width: 100%;
    width: 100%;
}

/* ===== Glass Card — Login Form ===== */
form.login-form {
    width: 100%;
    max-width: 420px;
    height: auto;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.12),
        0 2px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 36px 32px;
    position: relative;
    overflow: hidden;

    /* Entry animation */
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    animation: cardEntry 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

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

/* Animated rainbow accent bar */
form.login-form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        #6366f1,
        #8b5cf6,
        #a855f7,
        #ec4899,
        #f43f5e,
        #f97316,
        #eab308,
        #22c55e,
        #06b6d4,
        #6366f1
    );
    background-size: 300% 100%;
    animation: rainbowFlow 4s linear infinite;
    border-radius: 28px 28px 0 0;
}
@keyframes rainbowFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

/* Shimmer overlay */
form.login-form::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 42%,
        rgba(255, 255, 255, 0.35) 46%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0.35) 54%,
        transparent 58%
    );
    background-size: 300% 100%;
    animation: shimmer 8s ease-in-out infinite;
    pointer-events: none;
    border-radius: 28px;
    z-index: 0;
}
@keyframes shimmer {
    0%,
    100% {
        background-position: 300% 0;
    }
    50% {
        background-position: -50% 0;
    }
}

/* All form children above shimmer */
form.login-form > * {
    position: relative;
    z-index: 1;
}

/* Hover lift */
form.login-form:hover {
    box-shadow:
        0 16px 56px rgba(0, 0, 0, 0.16),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ===== Logo ===== */
.logo {
    text-align: center;
    margin-bottom: 10px;
}
.logo img {
    width: 240px;
    max-width: 75%;
    height: auto;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.08));
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: logoEntry 0.7s ease both 0.4s;
}
@keyframes logoEntry {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
.logo img:hover {
    transform: scale(1.06);
}

/* ===== Greeting ===== */
.login-greeting {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeUp 0.7s ease both 0.5s;
}
.login-greeting h5 {
    font-family: "Inter", sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: #1e293b;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}
.login-greeting p {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Input Fields ===== */
.input-group-modern {
    position: relative;
    margin-bottom: 18px;
    animation: slideInLeft 0.6s ease both;
}
.input-group-modern:nth-child(1) {
    animation-delay: 0.55s;
}
.input-group-modern:nth-child(2) {
    animation-delay: 0.65s;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-18px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.input-group-modern .input-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 3;
    display: flex;
    align-items: center;
}
.input-group-modern .input-icon-left svg {
    width: 18px;
    height: 18px;
}

.input-group-modern input {
    width: 100%;
    height: 52px;
    padding: 0 50px 0 48px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
    outline: none;
    transition: all 0.3s ease;
    margin-top: 0;
}
.input-group-modern input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
.input-group-modern input:focus {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.input-group-modern input:focus ~ .input-icon-left {
    color: #6366f1;
}

.input-group-modern label {
    display: block;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 6px;
    margin-top: 0;
    letter-spacing: 0.2px;
}

/* ===== Toggle Password ===== */
.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    z-index: 3;
    margin: 0;
    width: auto;
    height: auto;
}
.toggle-pw:hover {
    color: #6366f1;
    background: none;
}
.toggle-pw svg {
    width: 18px;
    height: 18px;
}

/* ===== Turnstile ===== */
.turnstile-wrapper {
    display: flex;
    justify-content: center;
    margin: 6px 0 4px;
    animation: fadeUp 0.6s ease both 0.75s;
}

/* ===== Login Button ===== */
.btn-login-modern {
    width: 100%;
    padding: 14px 24px;
    margin-top: 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    background-size: 200% 200%;
    color: #fff;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    animation: fadeUp 0.6s ease both 0.85s;
}
.btn-login-modern:hover {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
}
.btn-login-modern:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.btn-login-modern:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Ripple */
.btn-login-modern .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== Play Store & Footer ===== */
.single-icon {
    margin-top: 24px;
    text-align: center;
    animation: fadeUp 0.6s ease both 0.9s;
}
.single-icon img {
    width: 55%;
    max-width: 160px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.85;
}
.single-icon img:hover {
    transform: scale(1.06);
    opacity: 1;
}

.footer-text {
    text-align: center;
    margin-top: 16px;
    font-family: "Inter", sans-serif;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.6;
    animation: fadeUp 0.6s ease both 0.95s;
}
.footer-text b {
    color: #475569;
    font-weight: 600;
}
.footer-text a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}
.footer-text a:hover {
    text-decoration: underline;
}

/* ===== Error Styling ===== */
.error-message {
    color: #ef4444;
    font-family: "Inter", sans-serif;
    font-size: 0.72rem;
    margin-top: 5px;
    font-weight: 500;
}

.is-invalid,
.input-error {
    border-color: #ef4444 !important;
    background-color: rgba(254, 226, 226, 0.5) !important;
}

/* Shake animation for errors */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-6px);
    }
    40% {
        transform: translateX(6px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ===== Spinner ===== */
.spinner-border {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* ===== Floating Particles Background ===== */
.particles-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.particles-bg span {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    bottom: -10px;
    animation: floatUp var(--dur, 12s) linear infinite;
}
@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    form.login-form {
        max-width: 95%;
        padding: 32px 22px 26px;
        border-radius: 22px;
    }
    form.login-form::before {
        border-radius: 22px 22px 0 0;
    }
    form.login-form::after {
        border-radius: 22px;
    }

    .logo img {
        width: 180px;
    }
    .login-greeting h5 {
        font-size: 1.15rem;
    }
    .input-group-modern input {
        height: 48px;
        font-size: 0.85rem;
    }
    .btn-login-modern {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    .single-icon img {
        width: 65%;
    }
    .footer-text {
        font-size: 0.7rem;
    }
}
