﻿/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

:root {
    --bg: #050816;
    --bg2: #09111f;
    --cyan: #28f6ff;
    --green: #00e5b3;
    --purple: #8b5cf6;
    --white: #ffffff;
}

body {
    background: var(--bg);
    color: white;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* BACKGROUND */
.background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

/* GRID */
.grid {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 55px 55px;
    opacity: .25;
    mask-image: radial-gradient(circle, white 30%, transparent 95%);
    -webkit-mask-image: radial-gradient(circle, white 30%, transparent 95%);
}

/* NOISE */
.noise {
    position: absolute;
    inset: 0;
    opacity: .035;
    background-image: radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 6px 6px;
}

/* MESH GRADIENT */
.mesh {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(0,229,179,.20), transparent 30%), radial-gradient(circle at 85% 18%, rgba(40,246,255,.18), transparent 30%), radial-gradient(circle at 70% 80%, rgba(139,92,246,.20), transparent 35%), radial-gradient(circle at 25% 80%, rgba(0,229,179,.15), transparent 30%);
}

/* BLOBS */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: .65;
    animation: blobMove 16s ease-in-out infinite alternate;
}

.blob1 {
    width: 500px;
    height: 500px;
    background: #00e5b3;
    top: -160px;
    left: -140px;
}

.blob2 {
    width: 460px;
    height: 460px;
    background: #28f6ff;
    top: 120px;
    right: -160px;
    animation-delay: 5s;
}

.blob3 {
    width: 520px;
    height: 520px;
    background: #8b5cf6;
    bottom: -200px;
    left: 35%;
    animation-delay: 9s;
}

@keyframes blobMove {
    0% {
        transform: translate(0,0) scale(1);
    }

    50% {
        transform: translate(70px,-60px) scale(1.15);
    }

    100% {
        transform: translate(-40px,80px) scale(.95);
    }
}

/* WRAPPER (FIXED VERTICAL OVERFLOW & ADDED BACKSPACE MARGINS) */
.wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    padding: 40px 20px; /* Forces guaranteed breathing room around the card */
}

/* LOGIN CARD */
.login-card {
    position: relative;
    width: 460px;
    max-width: 100%;
    padding: 48px;
    border-radius: 32px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
    isolation: isolate;
    transition: transform .35s ease, box-shadow .35s ease;
}

    .login-card:hover {
        box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 0 80px rgba(0,229,179,.10);
    }

/* ANIMATED BORDER */
.card-border {
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 1.5px;
    background: conic-gradient(from 0deg, transparent, rgba(0,229,179,.85), transparent, rgba(40,246,255,.85), transparent, rgba(139,92,246,.85), transparent);
    animation: borderRotate 8s linear infinite;
    z-index: -1;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

@keyframes borderRotate {
    to {
        transform: rotate(360deg);
    }
}

/* GLASS REFLECTION */
.glass-reflection {
    position: absolute;
    top: -40%;
    left: -25%;
    width: 180px;
    height: 180%;
    transform: rotate(25deg);
    background: linear-gradient(to right, transparent, rgba(255,255,255,.12), transparent);
    opacity: .25;
    pointer-events: none;
    animation: reflection 7s linear infinite;
}

@keyframes reflection {
    0% {
        transform: translateX(-280px) rotate(25deg);
    }

    100% {
        transform: translateX(650px) rotate(25deg);
    }
}

/* MOUSE GLOW */
.mouse-glow {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,229,179,.22), transparent 70%);
    filter: blur(18px);
    pointer-events: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    opacity: .8;
}

/* CARD DECORATION */
.login-card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -120px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.08), transparent);
}

.login-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    left: -80px;
    bottom: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,229,179,.08), transparent);
}

/* ENTRANCE ANIMATION */
.login-card {
    animation: cardEntrance .9s ease;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(50px) scale(.94);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* LOGO SECTION */
.logo {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--green), var(--cyan), var(--purple), var(--green));
    animation: logoSpin 6s linear infinite;
    filter: drop-shadow(0 0 18px rgba(0,229,179,.5));
}

    .logo-ring::after {
        content: "";
        position: absolute;
        inset: 3px;
        background: #07101c;
        border-radius: 50%;
    }

.logo-box {
    position: relative;
    z-index: 2;
    width: 76px;
    height: 76px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 34px;
    /* ── Solid White Background for Maximum Contrast ── */
    background: black;
    /* Soft shadow to lift it off the dark ring */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

    .logo-box i {
        animation: logoPulse 3s ease-in-out infinite;
    }

@keyframes logoSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* HEADING */
.heading {
    text-align: center;
    margin-bottom: 42px;
}

    .heading h1 {
        font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
        font-size: 34px;
        font-weight: 700;
        letter-spacing: -1px;
        color: white;
        line-height: 1.2;
        background: linear-gradient(90deg, #ffffff, #b9fff0);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .heading p {
        margin-top: 12px;
        font-size: 15px;
        color: #94a3b8;
        letter-spacing: .3px;
    }

.logo {
    animation: logoEntrance .8s ease .15s both;
}

.heading {
    animation: headingEntrance .8s ease .3s both;
}

@keyframes logoEntrance {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes headingEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FORM INPUTS */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    position: relative;
    width: 100%;
    opacity: 0;
    animation: inputReveal .7s ease forwards;
}

    .input-group:nth-child(1) {
        animation-delay: .45s;
    }

    .input-group:nth-child(2) {
        animation-delay: .6s;
    }

@keyframes inputReveal {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group input {
    width: 100%;
    height: 64px;
    padding: 22px 52px 8px 52px;
    border-radius: 18px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.10);
    color: white;
    outline: none;
    font-size: 15px;
    transition: .35s ease;
}

.input-group > i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #8fa3bd;
    transition: .35s;
    z-index: 2;
}

.input-group label {
    position: absolute;
    left: 52px;
    top: 21px;
    color: #8fa3bd;
    font-size: 15px;
    pointer-events: none;
    transition: .35s ease;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: 9px;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--green);
    text-transform: uppercase;
}

.input-group input:focus {
    border-color: rgba(0,229,179,.8);
    background: rgba(255,255,255,.06);
    box-shadow: 0 0 0 4px rgba(0,229,179,.08), 0 0 30px rgba(0,229,179,.18);
}

    .input-group input:focus ~ i {
        color: var(--green);
    }

.input-group:hover input {
    border-color: rgba(255,255,255,.25);
}

/* PASSWORD TOGGLE */
.toggle-password {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8fa3bd;
    font-size: 20px;
    transition: .3s;
}

    .toggle-password:hover {
        color: var(--green);
        transform: translateY(-50%) scale(1.15);
    }

/* OPTIONS ROW */
.options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 14px;
}

    .options a {
        color: var(--green);
        text-decoration: none;
        transition: .3s;
    }

        .options a:hover {
            color: white;
        }

/* PREMIUM LOGIN BUTTON */
.login-btn {
    position: relative;
    width: 100%;
    height: 62px;
    margin-top: 12px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #03131a;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00e5b3, #28f6ff);
    box-shadow: 0 15px 35px rgba(0,229,179,.25);
    transition: transform .35s ease, box-shadow .35s ease;
    opacity: 0;
    animation: buttonReveal .8s ease .8s forwards;
}

@keyframes buttonReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-btn span {
    position: relative;
    z-index: 3;
}

.login-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,.75), transparent);
    transform: skewX(-25deg);
    transition: .8s;
}

.login-btn:hover::before {
    left: 150%;
}

.login-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,.35), transparent);
    opacity: 0;
    transition: .35s;
}

.login-btn:hover::after {
    opacity: 1;
}

.login-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 55px rgba(0,229,179,.45);
}

.login-btn:active {
    transform: scale(.96);
}

.login-btn.loading {
    pointer-events: none;
    opacity: .85;
}

    .login-btn.loading span {
        font-size: 0;
    }

        .login-btn.loading span::after {
            content: "";
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: 3px solid rgba(0,0,0,.25);
            border-top-color: #041018;
            display: block;
            animation: spin .8s linear infinite;
        }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-btn.success {
    background: linear-gradient(135deg, #22c55e, #86efac);
    box-shadow: 0 20px 45px rgba(34,197,94,.35);
}

    .login-btn.success span::after {
        content: " ✓";
        font-size: 18px;
    }

::selection {
    background: #00e5b3;
    color: #031018;
}

/* RESPONSIVE MEDIA QUERIES FOR ALL SCREEN SIZES */
@media(max-width: 768px) {
    .wrapper {
        padding: 24px 16px; /* Retains essential outer spacing on medium tablets/mobiles */
    }

    .login-card {
        padding: 40px 32px;
        border-radius: 28px;
    }

    .heading h1 {
        font-size: 30px;
    }

    .heading {
        margin-bottom: 32px;
    }
}

@media(max-width: 480px) {
    .wrapper {
        padding: 16px 12px; /* Adaptive minimum safe margin for small mobile displays */
    }

    .login-card {
        padding: 32px 20px;
        border-radius: 24px;
    }

    .heading h1 {
        font-size: 26px;
    }

    .heading p {
        font-size: 14px;
        margin-top: 8px;
    }

    .logo {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .logo-box {
        width: 66px;
        height: 66px;
        font-size: 28px;
    }

    .input-group input {
        height: 58px;
        padding: 20px 44px 6px 44px;
        border-radius: 14px;
        font-size: 14px;
    }

    .input-group label {
        left: 44px;
        top: 18px;
        font-size: 14px;
    }

    .input-group input:focus + label,
    .input-group input:not(:placeholder-shown) + label {
        top: 6px;
        font-size: 10px;
    }

    .input-group > i {
        left: 16px;
        font-size: 18px;
    }

    .toggle-password {
        right: 16px;
        font-size: 18px;
    }

    .login-btn {
        height: 56px;
        border-radius: 16px;
        font-size: 14px;
    }
}
/* MATCH AUTOFILL STYLING EXACTLY WITH GLASS FIELD THEME */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--white) !important;
    /* Blends the base color and glass overlay transparency exactly */
    box-shadow: 0 0 0px 1000px unset inset !important;
    transition: background-color 5000s ease-in-out 0s;
    border-color: rgba(255, 255, 255, 0.05);
}

   /* .input-group input:-webkit-autofill:focus {
        border-color: rgba(223, 183, 108, 0.35) !important;
        box-shadow: 0 0 0px 1000px unset inset, 0 0 30px rgba(223, 183, 108, 0.03) !important;
    }*/

/* Accessibility settings */
@media(prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
/* ─────────────────────────────────────────────────────────
   COMPANY LOGO INSIDE .logo-box
   Replaces the Font Awesome building icon. The image is
   scaled to fit 65% of the 76×76 box, preserving aspect
   ratio for wide/square/vertical logos alike.
   ───────────────────────────────────────────────────────── */

.logo-box img.logo-image {
    /* Make the logo slightly larger so it fills the white box nicely */
    max-width: 75%;
    max-height: 75%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    animation: logoPulse 3s ease-in-out infinite;
    /* Removed the green drop-shadow which was causing a fuzzy, muddy look */
    filter: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Fallback icon is hidden by default (only shown if the image fails) */
.logo-box .logo-fallback-icon {
    display: none;
    font-size: 34px;
    /* Make it blue so it shows up on the new white background */
    color: #1e40af;
    animation: logoPulse 3s ease-in-out infinite;
}