:root {
    --slate-950: #071425;
    --slate-900: #0f172a;
    --slate-800: #1f2937;
    --slate-700: #334155;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-300: #93c5fd;
    --blue-200: #bfdbfe;
    --white: #ffffff;
    --error-bg: #fff3ef;
    --error-line: #ea580c;
}

* {
    box-sizing: border-box;
}

body.logon-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Zen Kaku Gothic New", "M PLUS 1p", sans-serif;
    background: var(--slate-50);
    color: var(--slate-900);
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

.hero {
    display: none;
}

.auth-area {
    position: relative;
    padding: 2rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.22) 1px, transparent 1px);
    background-size: 3rem 3rem;
    mask-image: linear-gradient(to bottom left, #000 22%, transparent 82%);
}

.auth-grid-line-v,
.auth-grid-line-h {
    position: absolute;
    pointer-events: none;
}

.auth-grid-line-v {
    top: 0;
    left: 3.5rem;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--slate-300), transparent);
}

.auth-grid-line-h {
    top: 26%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--slate-200), transparent);
}

.auth-inner {
    width: min(100%, 28rem);
    position: relative;
    z-index: 2;
}

.mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.2rem;
}

.mobile-brand-mark {
    width: 3.1rem;
    height: 3.1rem;
    margin-bottom: 0.9rem;
    border-left: 4px solid var(--blue-600);
    background: var(--slate-900);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
    position: relative;
}

.mobile-brand-mark::before {
    content: "";
    position: absolute;
    inset: 0.65rem;
    border: 2px solid rgba(255, 255, 255, 0.88);
}

.mobile-brand h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.auth-heading {
    position: relative;
    margin-bottom: 2rem;
}

.auth-heading h2 {
    margin: 0;
    font-size: clamp(1.9rem, 5.5vw, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--slate-900);
}

.auth-heading p {
    margin: 0.75rem 0 0;
    color: var(--slate-500);
    font-size: 0.9rem;
    line-height: 1.8;
    font-weight: 500;
}

.error-box {
    margin-bottom: 1rem;
    border: 1px solid #fdba74;
    border-left: 4px solid var(--error-line);
    border-radius: 4px;
    background: var(--error-bg);
    color: #9a3412;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 1.15rem;
}

.field label {
    display: block;
    margin-bottom: 0.42rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--slate-700);
}

.field-control {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2rem;
    height: 1.2rem;
    pointer-events: none;
}

.input-icon::before,
.input-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid #94a3b8;
}

.input-icon.user::before {
    top: 0;
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    background: transparent;
}

.input-icon.user::after {
    top: 0.56rem;
    width: 0.88rem;
    height: 0.58rem;
    border-radius: 0.45rem 0.45rem 0.25rem 0.25rem;
    border-top: 0;
}

.input-icon.lock::before {
    top: 0;
    width: 0.58rem;
    height: 0.46rem;
    border-radius: 0.55rem 0.55rem 0 0;
    border-bottom: 0;
}

.input-icon.lock::after {
    top: 0.48rem;
    width: 0.92rem;
    height: 0.66rem;
    border-radius: 0.15rem;
}

.field input {
    width: 100%;
    height: 3.25rem;
    border: 1px solid var(--slate-300);
    border-radius: 2px;
    background: var(--white);
    padding: 0 0.95rem 0 2.7rem;
    font-size: 0.95rem;
    color: var(--slate-900);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
    color: #9aa8bb;
}

.field input:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 1px var(--blue-600);
}

.submit-wrap {
    padding-top: 0.45rem;
}

.submit-btn {
    width: 100%;
    min-height: 3.35rem;
    border: 0;
    border-radius: 2px;
    background: var(--blue-700);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.submit-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.submit-btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.26);
}

.submit-btn:hover::before {
    animation: shimmer 1.2s ease;
}

.submit-btn span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    z-index: 1;
}

.submit-btn span::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.submit-btn:hover span::after {
    transform: rotate(45deg) translate(1px, -1px);
}

.meta-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--slate-200);
    border-radius: 2px;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    position: relative;
}

.meta-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--blue-500);
}

.meta-item + .meta-item {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--slate-200);
}

.meta-item strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    color: var(--slate-700);
}

.meta-item p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--slate-500);
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

@media (min-width: 1024px) {
    .portal-shell {
        grid-template-columns: minmax(22rem, 46%) minmax(28rem, 54%);
    }

    .hero {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: relative;
        padding: 3rem 3rem 2.2rem;
        color: var(--white);
        background: linear-gradient(140deg, var(--slate-900), #071930 48%, #0f172a);
        overflow: hidden;
    }

    .hero-grid {
        position: absolute;
        inset: 0;
        pointer-events: none;
        background-image:
            linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
        background-size: 4rem 4rem;
        mask-image: linear-gradient(to bottom right, #000, transparent 84%);
    }

    .hero-shape-a,
    .hero-shape-b,
    .hero-line-a,
    .hero-line-b {
        position: absolute;
        pointer-events: none;
    }

    .hero-shape-a {
        top: -10%;
        right: -10%;
        width: 62%;
        height: 42%;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.03);
        transform: skewX(-12deg);
    }

    .hero-shape-b {
        left: -10%;
        bottom: -12%;
        width: 66%;
        height: 60%;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-right: 1px solid rgba(255, 255, 255, 0.12);
        transform: skewY(7deg);
        opacity: 0.55;
    }

    .hero-line-a {
        top: 23%;
        left: 0;
        width: 100%;
        height: 1px;
        transform: rotate(-34deg);
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    }

    .hero-line-b {
        right: 0;
        bottom: 30%;
        width: 100%;
        height: 1px;
        transform: rotate(12deg);
        background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.35), transparent);
    }

    .hero-content,
    .hero-foot {
        position: relative;
        z-index: 2;
    }

    .hero-brand {
        display: flex;
        align-items: center;
        gap: 0.9rem;
        margin-bottom: 4rem;
    }

    .hero-mark {
        width: 3.1rem;
        height: 3.1rem;
        border-left: 4px solid var(--blue-300);
        background: rgba(255, 255, 255, 0.12);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
        position: relative;
    }

    .hero-mark::before {
        content: "";
        position: absolute;
        inset: 0.62rem;
        border: 2px solid rgba(219, 234, 254, 0.95);
    }

    .hero-brand p {
        margin: 0;
        color: var(--blue-300);
        font-size: 0.75rem;
        letter-spacing: 0.15em;
        font-weight: 700;
    }

    .hero-brand h1 {
        margin: 0.25rem 0 0;
        font-size: 2rem;
        font-weight: 800;
        letter-spacing: 0.01em;
    }

    .hero h2 {
        margin: 0;
        font-size: clamp(2rem, 2.8vw, 3.3rem);
        line-height: 1.2;
        letter-spacing: 0.01em;
        font-weight: 800;
    }

    .hero-lead {
        margin: 1.1rem 0 2.8rem;
        max-width: 33rem;
        color: rgba(191, 219, 254, 0.95);
        font-size: 1.04rem;
        line-height: 1.9;
    }

    .feature-list {
        display: grid;
        gap: 1.4rem;
    }

    .feature-item {
        display: grid;
        grid-template-columns: 3rem 1fr;
        gap: 0.95rem;
        align-items: start;
    }

    .feature-icon {
        width: 3rem;
        height: 3rem;
        border-left: 2px solid var(--blue-300);
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(2px);
        position: relative;
    }

    .feature-icon::before,
    .feature-icon::after {
        content: "";
        position: absolute;
        border: 1px solid rgba(147, 197, 253, 0.85);
    }

    .feature-icon.layer::before {
        top: 0.75rem;
        left: 0.65rem;
        width: 1.45rem;
        height: 1rem;
    }

    .feature-icon.layer::after {
        top: 1.1rem;
        left: 0.8rem;
        width: 1.45rem;
        height: 1rem;
        background: rgba(147, 197, 253, 0.12);
    }

    .feature-icon.shield::before {
        top: 0.55rem;
        left: 0.9rem;
        width: 1.18rem;
        height: 1.45rem;
        border-radius: 0.55rem 0.55rem 0.8rem 0.8rem;
    }

    .feature-icon.shield::after {
        top: 1.3rem;
        left: 1.35rem;
        width: 0.3rem;
        height: 0.55rem;
        border-top: 0;
        border-left: 0;
        transform: rotate(45deg);
    }

    .feature-icon.server::before {
        top: 0.64rem;
        left: 0.75rem;
        width: 1.5rem;
        height: 0.66rem;
    }

    .feature-icon.server::after {
        top: 1.55rem;
        left: 0.75rem;
        width: 1.5rem;
        height: 0.66rem;
    }

    .feature-item strong {
        display: block;
        margin-bottom: 0.2rem;
        color: #ffffff;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .feature-item span {
        color: rgba(191, 219, 254, 0.85);
        font-size: 0.86rem;
        line-height: 1.65;
    }

    .hero-foot {
        color: rgba(148, 163, 184, 0.82);
        font-size: 0.78rem;
        letter-spacing: 0.04em;
        font-weight: 500;
    }

    .auth-area {
        padding: 3rem 4rem;
    }

    .mobile-brand {
        display: none;
    }

    .auth-heading::before {
        content: "";
        position: absolute;
        left: -0.9rem;
        top: 0.2rem;
        width: 4px;
        height: 2rem;
        background: var(--blue-600);
    }
}
