/* =========================================================
   Login Page
   Role: standalone login page reset, fullscreen background,
   glass login card, form controls, sunrise button,
   error state, responsive behavior and animations.

   Required background image:
   assets/img/login-bg.png
========================================================= */

/* =========================================================
   Reset
========================================================= */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

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

.login-body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    background: #0f172a;
    overflow-x: hidden;
}

/* =========================================================
   Page Layout / Background
========================================================= */

.login-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 24px;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    perspective-origin: center;
    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.10) 0%,
            rgba(15, 23, 42, 0.05) 45%,
            rgba(15, 23, 42, 0.28) 100%
        ),
        url("../img/login-bg.png") center center / cover no-repeat !important;
}

/* Star sparkle overlay */
.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    filter: none;
    z-index: 0;
    pointer-events: none;
    opacity: 0.95;
    background-image:
        radial-gradient(circle at 8% 8%, rgba(255,255,255,0.95) 0 1px, transparent 2px),
        radial-gradient(circle at 18% 16%, rgba(255,255,255,0.70) 0 1px, transparent 2px),
        radial-gradient(circle at 27% 7%, rgba(255,255,255,0.90) 0 1px, transparent 2px),
        radial-gradient(circle at 38% 14%, rgba(255,255,255,0.65) 0 1px, transparent 2px),
        radial-gradient(circle at 51% 8%, rgba(255,255,255,0.95) 0 1px, transparent 2px),
        radial-gradient(circle at 63% 16%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
        radial-gradient(circle at 76% 9%, rgba(255,255,255,0.90) 0 1px, transparent 2px),
        radial-gradient(circle at 88% 15%, rgba(255,255,255,0.72) 0 1px, transparent 2px),
        radial-gradient(circle at 95% 7%, rgba(255,255,255,0.95) 0 1px, transparent 2px),
        radial-gradient(circle at 13% 28%, rgba(255,255,255,0.52) 0 1px, transparent 2px),
        radial-gradient(circle at 31% 24%, rgba(255,255,255,0.62) 0 1px, transparent 2px),
        radial-gradient(circle at 47% 29%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
        radial-gradient(circle at 68% 25%, rgba(255,255,255,0.58) 0 1px, transparent 2px),
        radial-gradient(circle at 84% 30%, rgba(255,255,255,0.62) 0 1px, transparent 2px);
    animation: loginStarsTwinkle 4.5s ease-in-out infinite alternate;
}

/* Soft vignette, keeps the login card readable */
.login-page::after {
    content: "";
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    filter: none;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse at center,
            rgba(15, 23, 42, 0.02) 0%,
            rgba(15, 23, 42, 0.10) 54%,
            rgba(15, 23, 42, 0.28) 100%
        );
    animation: none;
}

@media (min-width: 769px) {
    html,
    body,
    .login-body {
        width: 100%;
        height: 100%;
        min-height: 100%;
        overflow: hidden;
    }

    .login-page {
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
    }
}

/* =========================================================
   Login Card / Glass Box
========================================================= */

.login-card,
.login-box {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    padding: 34px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.26) !important;
    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.62),
            rgba(15, 23, 42, 0.38)
        ) !important;
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.42),
        0 0 40px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.28) !important;
    transform-style: preserve-3d;
    animation: loginCardEnter 0.65s ease both;
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

.login-card::before,
.login-box::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            120deg,
            transparent 0%,
            rgba(255, 255, 255, 0.055) 30%,
            transparent 58%
        );
    transform: translateX(-125%);
    animation: loginCardShine 5.4s ease-in-out infinite;
}

.login-card::after,
.login-box::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.07),
            rgba(15, 23, 42, 0.06) 42%,
            rgba(0, 0, 0, 0.16) 100%
        ) !important;
}

.login-card:hover,
.login-box:hover {
    transform: translateY(-5px) rotateX(2deg);
    border-color: rgba(255, 255, 255, 0.34) !important;
    box-shadow:
        0 34px 85px rgba(0, 0, 0, 0.38),
        0 0 35px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.22) !important;
}

.login-header,
.login-form,
.login-error,
.login-card form,
.login-box form {
    position: relative;
    z-index: 2;
    transform: translateZ(18px);
}

/* =========================================================
   Login Header
========================================================= */

.login-header {
    margin-bottom: 22px;
}

.login-badge {
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #ffffff !important;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.34),
        0 10px 24px rgba(0, 0, 0, 0.22);
}

.login-header h1,
.login-title,
.login-card h1,
.login-box h1 {
    margin: 0 0 14px;
    font-size: 31px;
    line-height: 1.15;
    font-weight: 900;
    color: #ffffff !important;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.34),
        0 10px 24px rgba(0, 0, 0, 0.22);
}

.login-header p,
.login-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 15px;
    font-weight: 650;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

/* =========================================================
   Login Form
========================================================= */

.login-form,
.login-card form,
.login-box form {
    display: grid;
    gap: 17px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field label,
.login-card label,
.login-box label {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 800;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.34),
        0 10px 24px rgba(0, 0, 0, 0.22);
}

.login-field input,
.login-card input,
.login-box input {
    width: 100%;
    min-height: 48px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.46),
            rgba(15, 23, 42, 0.28)
        ) !important;
    color: #ffffff !important;
    padding: 0 15px;
    font-size: 15px;
    outline: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18),
        0 10px 24px rgba(0, 0, 0, 0.16) !important;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.login-field input::placeholder,
.login-card input::placeholder,
.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.68) !important;
}

.login-field input:hover,
.login-card input:hover,
.login-box input:hover {
    border-color: rgba(255, 255, 255, 0.38) !important;
    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.50),
            rgba(15, 23, 42, 0.30)
        ) !important;
}

.login-field input:focus,
.login-card input:focus,
.login-box input:focus {
    border-color: rgba(255, 255, 255, 0.62) !important;
    background:
        linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.54),
            rgba(15, 23, 42, 0.34)
        ) !important;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.16),
        0 0 28px rgba(255, 255, 255, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(0, 0, 0, 0.20) !important;
    transform: translateY(-1px);
}

.login-field input:-webkit-autofill,
.login-card input:-webkit-autofill,
.login-box input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    box-shadow:
        0 0 0 1000px rgba(15, 23, 42, 0.38) inset,
        inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    transition: background-color 9999s ease-in-out 0s;
}

.password-field-wrap {
    display: block;
    width: 100%;
}

.password-field-wrap input {
    width: 100%;
}

/* =========================================================
   Login Button / Sunrise Style
========================================================= */

.login-submit,
.login-card button,
.login-box button,
.login-card button[type="submit"],
.login-box button[type="submit"] {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 50px;
    margin-top: 2px;
    border: 0 !important;
    outline: none !important;
    border-radius: 14px;
    background:
        linear-gradient(
            180deg,
            #ffd166 0%,
            #fb923c 46%,
            #f97316 72%,
            #db2777 100%
        ) !important;
    background-clip: padding-box !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    box-shadow:
        0 3px 0 rgba(154, 52, 18, 0.50),
        0 10px 20px rgba(249, 115, 22, 0.22),
        0 0 16px rgba(251, 146, 60, 0.10) !important;
    transform: translateY(0);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease;
}

.login-submit::before,
.login-card button::before,
.login-box button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 58%;
    height: 100%;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.36),
            transparent
        );
    transform: skewX(-18deg);
    transition: left 0.45s ease;
}

.login-submit::after,
.login-card button::after,
.login-box button::after {
    display: none !important;
    content: none !important;
}

.login-submit:hover,
.login-card button:hover,
.login-box button:hover,
.login-card button[type="submit"]:hover,
.login-box button[type="submit"]:hover {
    transform: translateY(-2px);
    filter: brightness(1.05) saturate(1.04);
    border: 0 !important;
    box-shadow:
        0 4px 0 rgba(154, 52, 18, 0.52),
        0 13px 24px rgba(249, 115, 22, 0.26),
        0 0 18px rgba(251, 146, 60, 0.13) !important;
}

.login-submit:hover::before,
.login-card button:hover::before,
.login-box button:hover::before {
    left: 125%;
}

.login-submit:active,
.login-card button:active,
.login-box button:active,
.login-card button[type="submit"]:active,
.login-box button[type="submit"]:active {
    transform: translateY(3px);
    border: 0 !important;
    box-shadow:
        0 1px 0 rgba(154, 52, 18, 0.55),
        0 6px 14px rgba(249, 115, 22, 0.20) !important;
}

/* =========================================================
   Login Error
========================================================= */

.login-error {
    margin-bottom: 17px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.38);
    color: #fecaca;
    padding: 12px 14px;
    border-radius: 13px;
    font-size: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 12px 28px rgba(127, 29, 29, 0.18);
}

/* =========================================================
   Animations
========================================================= */

@keyframes loginCardEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

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

@keyframes loginCardShine {
    0% {
        transform: translateX(-125%);
    }

    42% {
        transform: translateX(125%);
    }

    100% {
        transform: translateX(125%);
    }
}

@keyframes loginStarsTwinkle {
    from {
        opacity: 0.45;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.012);
    }
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 520px) {
    .login-page {
        padding: 18px;
        align-items: center;
    }

    .login-card,
    .login-box {
        max-width: 100%;
        padding: 28px 22px;
        border-radius: 20px;
    }

    .login-header h1,
    .login-title,
    .login-card h1,
    .login-box h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .login-card:hover,
    .login-box:hover {
        transform: none;
    }

    .login-header,
    .login-form,
    .login-error,
    .login-card form,
    .login-box form {
        transform: none;
    }

    .login-submit,
    .login-card button,
    .login-box button {
        box-shadow:
            0 2px 0 rgba(154, 52, 18, 0.50),
            0 8px 16px rgba(249, 115, 22, 0.20),
            0 0 12px rgba(251, 146, 60, 0.08) !important;
    }

    .login-submit:active,
    .login-card button:active,
    .login-box button:active {
        transform: translateY(2px);
        box-shadow:
            0 1px 0 rgba(154, 52, 18, 0.50),
            0 5px 12px rgba(249, 115, 22, 0.18) !important;
    }
}

/* =========================================================
   Accessibility
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-card,
    .login-card::before,
    .login-box,
    .login-box::before {
        animation: none;
    }

    .login-card,
    .login-box,
    .login-field input,
    .login-card input,
    .login-box input,
    .login-submit,
    .login-card button,
    .login-box button {
        transition: none;
    }
}
/* =========================================================
   LOGIN BACKGROUND - MOBILE IMAGE POSITION
   Shows the right side of the background image on mobile.
========================================================= */

@media (max-width: 768px) {
    .login-page {
        background:
            linear-gradient(
                180deg,
                rgba(15, 23, 42, 0.10) 0%,
                rgba(15, 23, 42, 0.05) 45%,
                rgba(15, 23, 42, 0.28) 100%
            ),
            url("../img/login-bg.png") 78% center / cover no-repeat !important;
    }
}
