:root {
    color-scheme: dark;
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    --accent: #14e0c8;
    --accent-2: #3b9bff;
    background: #050b17;
    color: #edf6ff;
}

* { box-sizing: border-box; }

body {
    position: relative;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.login-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 20%, rgba(20, 224, 200, 0.18), transparent 38%),
        radial-gradient(circle at 85% 80%, rgba(59, 155, 255, 0.2), transparent 42%),
        linear-gradient(        rgba(5, 11, 23, 0.94), rgba(5, 11, 23, 0.97)),
        url("images/login.jpeg") center / cover no-repeat;
            filter: saturate(1.1) blur(3px);
}

.login-backdrop::after {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 190, 230, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 190, 230, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
    content: "";
}

.login-layout {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
    gap: clamp(32px, 8vw, 140px);
    align-items: center;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 40px clamp(20px, 5vw, 48px);
}

.login-hero { animation: rise 0.7s ease both; }

.hero-kicker {
    margin: 0 0 22px;
    color: #9fb6d0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.22em;
}

.login-hero h2 {
    display: flex;
    flex-direction: column;
    margin: 0;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.12;
}

.login-hero h2 span {
    font-size: clamp(3.4rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.login-hero h2 strong {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.hero-tagline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 34px;
    color: #a9bbd1;
    font-size: 1.05rem;
}

.hero-tagline i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.hero-stats { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-stats div {
    display: grid;
    gap: 4px;
    min-width: 130px;
    padding: 12px 18px;
    border: 1px solid rgba(120, 190, 230, 0.22);
    border-radius: 14px;
    background: rgba(12, 28, 50, 0.55);
    backdrop-filter: blur(10px);
}

.hero-stats span { color: #8ea5bf; font-size: 0.68rem; letter-spacing: 0.14em; }
.hero-stats strong { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }

.pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3df0a0;
    box-shadow: 0 0 0 0 rgba(61, 240, 160, 0.6);
    animation: pulse 2s infinite;
}

.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: clamp(30px, 4vw, 46px);
    border: 1px solid rgba(140, 210, 240, 0.2);
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(18, 38, 66, 0.72), rgba(8, 20, 38, 0.82));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(22px);
    animation: rise 0.7s 0.1s ease both;
}

.login-panel::before {
    position: absolute;
    top: -1px;
    left: 18%;
    right: 18%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    content: "";
}

.login-emblem {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    align-self: center;
    margin-bottom: 18px;
    border: 2px solid rgba(20, 224, 200, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 26px rgba(20, 224, 200, 0.25);
}

.login-emblem span {
    width: 24px;
    height: 24px;
    border: 4px double var(--accent);
    border-radius: 50%;
}

.login-eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
}

.login-panel h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    text-align: center;
}

.login-description {
    margin: 8px 0 26px;
    color: #9fb2c8;
    font-size: 0.9rem;
    text-align: center;
}

#login-form { display: grid; gap: 16px; }

.field { position: relative; }

.field input {
    width: 100%;
    height: 54px;
    padding: 20px 46px 6px 16px;
    border: 1px solid rgba(100, 160, 210, 0.4);
    border-radius: 12px;
    outline: none;
    background: rgba(4, 14, 30, 0.7);
    color: #f2f7ff;
    font: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field label {
    position: absolute;
    top: 50%;
    left: 16px;
    color: #8fa6bf;
    font-size: 0.92rem;
    pointer-events: none;
    transform: translateY(-50%);
    transition: all 0.18s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
    top: 17px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(20, 224, 200, 0.14);
}

.field > svg,
.toggle-password svg { width: 20px; height: 20px; fill: currentColor; }

.field > svg {
    position: absolute;
    top: 17px;
    right: 15px;
    color: #6f88a6;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    top: 7px;
    right: 8px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6f88a6;
    cursor: pointer;
}

.toggle-password:hover, .toggle-password[aria-pressed="true"] { color: var(--accent); }

#login-submit {
    display: flex;
    height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(100deg, var(--accent), #12b8d8);
    color: #04202e;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(20, 224, 200, 0.28);
    transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

#login-submit svg { width: 18px; height: 18px; fill: currentColor; transition: transform 0.18s; }
#login-submit:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 32px rgba(20, 224, 200, 0.38); }
#login-submit:hover:not(:disabled) svg { transform: translateX(4px); }
#login-submit:disabled { cursor: wait; opacity: 0.75; }

.login-error {
    min-height: 18px;
    margin: -4px 0 0;
    color: #ff9da8;
    font-size: 0.82rem;
}

.login-footer {
    margin: 22px 0 0;
    color: #8196ae;
    font-size: 0.76rem;
    text-align: center;
}

.login-footer span { padding: 0 5px; color: var(--accent); }

.login-meta {
    display: flex;
    justify-content: space-between;
    padding: 18px clamp(20px, 5vw, 48px);
    color: #6f86a1;
    font-size: 0.76rem;
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(61, 240, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 240, 160, 0); } }

#plant-status-text {
    color: #14e0c8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

#plant-status-text.online {
    color: #14e0c8;
}

#plant-status-text.offline {
    color: #ff6b6b;
}

@media (prefers-reduced-motion: reduce) {
    .login-hero, .login-panel, .pulse { animation: none; }
}

@media (max-width: 900px) {
    .login-layout { grid-template-columns: minmax(0, 460px); justify-content: center; gap: 28px; }
    .login-hero { text-align: center; }
    .hero-tagline, .hero-stats { justify-content: center; }
    .hero-stats { display: none; }
}

@media (max-width: 480px) {
    .login-hero h2 span { font-size: 3rem; }
    .login-meta { flex-direction: column; gap: 4px; align-items: center; }
}
