:root {
    --page-bg: #0a1837;
    --card-bg: rgba(255, 255, 255, 0.98);
    --panel-bg: #f5f8fc;
    --text-main: #102347;
    --text-soft: #6f84a7;
    --line: #dbe6f7;
    --primary: #2e63e6;
    --primary-dark: #2348bc;
    --focus: #7aa4ff;
}

* {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Sora', sans-serif;
    color: var(--text-main);
    background: #ffffff;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 0;
}

.login-stage {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(420px, 470px);
    overflow: hidden;
    border-radius: 0;
    border: 0;
    background: linear-gradient(180deg, #ffffff 0%, var(--panel-bg) 100%);
    box-shadow: none;
}

.login-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 44px 36px;
    overflow: hidden;
    background:
        linear-gradient(110deg, rgba(5, 31, 87, 0.84), rgba(12, 96, 196, 0.2)),
        url('/images/baground_login.png') center center / cover no-repeat;
}

.login-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 58%, rgba(255, 151, 77, 0.24), transparent 15%),
        radial-gradient(circle at 72% 26%, rgba(255, 255, 255, 0.22), transparent 18%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.login-visual__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 760px);
    min-height: 100%;
}

.login-visual__hero {
    display: block;
    width: min(100%, 980px);
    height: auto;
    margin: 15px auto 0;
    transform: translateY(-30px);
    filter: drop-shadow(0 20px 38px rgba(0, 0, 0, 0.28));
}

.login-visual__copy {
    max-width: 430px;
    margin-top: 28px;
}

.login-visual__title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.75rem, 2.4vw, 2.55rem);
    line-height: 1.2;
    font-weight: 800;
}

.login-visual__tagline {
    margin: 12px 0 0;
    color: rgba(232, 240, 255, 0.88);
    font-size: 1rem;
    line-height: 1.65;
    font-weight: 400;
}

.login-panel {
    --login-card-width: min(100%, 410px);
    --login-card-offset-x: -110px;
    --login-card-height: 520px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 28px 26px 28px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
}

.login-panel::before {
    content: '';
    position: absolute;
    left: -88px;
    top: -8%;
    width: 180px;
    height: 116%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.98));
    transform: skewX(-12deg);
    box-shadow: 18px 0 48px rgba(12, 43, 92, 0.07);
}

.login-panel::after {
    content: '';
    position: absolute;
    top: 14px;
    right: 14px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(35, 90, 180, 0.08), transparent 68%);
}

.login-mobile-visual {
    display: none;
}

.login-card {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    width: var(--login-card-width);
    margin: 0 0 0 var(--login-card-offset-x);
    padding: 34px;
    border-radius: 28px;
    border: 1px solid rgba(219, 230, 247, 0.92);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
    box-shadow: 0 20px 44px rgba(16, 43, 114, 0.08);
}

.login-card__header {
    margin-bottom: 26px;
    text-align: center;
}

.login-card__logo {
    display: block;
    width: min(150px, 70%);
    height: auto;
    margin: 0 auto 18px;
}

.login-card__header h1 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(1.5rem, 1.8vw, 1.95rem);
    line-height: 1.18;
    font-weight: 800;
}

.login-status {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #deebff;
    border-radius: 14px;
    background: #f3f8ff;
    color: #38598d;
    font-size: 0.86rem;
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 14px;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    color: #233a67;
    font-size: 0.84rem;
    font-weight: 700;
}

.field-control {
    position: relative;
}

.field-icon,
.field-action {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: #8493af;
}

.field-icon {
    left: 16px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.field-action {
    right: 14px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.field-icon svg,
.field-action svg {
    width: 18px;
    height: 18px;
}

.field-action:hover,
.field-action:focus-visible {
    color: #4e648a;
}

.field-action:focus-visible {
    outline: none;
    transform: translateY(-50%) scale(1.05);
}

.form-group input {
    width: 100%;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: 0 54px 0 46px;
    color: var(--text-main);
    font-size: 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input::placeholder {
    color: #99a7bd;
}

.form-group input:focus {
    outline: none;
    border-color: var(--focus);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(46, 99, 230, 0.12);
}

.form-error {
    margin: 0;
    color: #d90429;
    font-size: 0.78rem;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.82rem;
    cursor: pointer;
}

.remember-option input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.login-help {
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

.login-button {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #365fe2 0%, var(--primary-dark) 100%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 36px rgba(35, 72, 188, 0.22);
    transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-button:hover {
    background: linear-gradient(180deg, #4b72ea 0%, var(--primary-dark) 100%);
    box-shadow: 0 20px 38px rgba(35, 72, 188, 0.26);
    transform: translateY(-1px);
}

.login-button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.96),
        0 0 0 8px rgba(46, 99, 230, 0.22);
}

.login-footer {
    position: absolute;
    z-index: 1;
    left: var(--login-card-offset-x);
    top: calc(50% + (var(--login-card-height) / 2));
    width: var(--login-card-width);
    min-height: calc(50% - (var(--login-card-height) / 2));
    margin: 0;
    color: #76839b;
    font-size: 0.76rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 1024px) {
    .login-shell {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
    }

    .login-stage {
        grid-template-columns: 1fr;
        min-height: 100vh;
        min-height: 100dvh;
        max-width: 100%;
        border-radius: 0;
        align-content: start;
    }

    .login-visual {
        display: none;
    }

    .login-panel {
        justify-content: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0 20px 24px;
        gap: 18px;
    }

    .login-panel::before,
    .login-panel::after {
        display: none;
    }

    .login-mobile-visual {
        position: relative;
        display: block;
        margin: 0 -20px;
        min-height: 360px;
        padding: 36px 24px 132px;
        overflow: hidden;
        background:
            linear-gradient(120deg, rgba(6, 31, 86, 0.84), rgba(9, 91, 188, 0.16)),
            url('/images/baground_login.png') center center / cover no-repeat;
        border-bottom: 1px solid rgba(18, 49, 102, 0.08);
    }

    .login-mobile-visual__hero {
        display: block;
        width: min(420px, 86%);
        height: auto;
        margin: 8px auto 0;
        filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.24));
    }

    .login-card {
        align-self: center;
        margin: -96px auto 0;
        width: min(100%, 460px);
    }

    .login-footer {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        min-height: auto;
        width: 100%;
        margin-top: auto;
        padding-top: 24px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .login-mobile-visual {
        min-height: 400px;
        padding: 42px 28px 148px;
    }

    .login-mobile-visual__hero {
        width: min(500px, 82%);
    }

    .login-card {
        width: min(100%, 560px);
        margin-top: -118px;
        padding: 34px 32px 28px;
        border-radius: 30px;
    }

    .login-card__logo {
        width: 110px;
        margin-bottom: 18px;
    }

    .login-card__header h1 {
        font-size: 2.15rem;
    }

    .login-form {
        gap: 16px;
    }

    .form-group {
        gap: 8px;
    }

    .form-group label,
    .remember-option,
    .forgot-link {
        font-size: 0.92rem;
    }

    .form-group input {
        font-size: 0.96rem;
    }

    .login-button {
        font-size: 1rem;
    }

    .form-row {
        margin-top: 4px;
    }

    .login-footer {
        font-size: 0.82rem;
        padding-bottom: 8px;
    }
}

@media (max-width: 640px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: none;
    }

    .login-page {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-shell {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
        overflow: visible;
    }

    .login-stage {
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0 16px 16px;
        overflow: visible;
    }

    .login-mobile-visual {
        min-height: 240px;
        padding: 18px 16px 76px;
        flex-shrink: 0;
    }

    .login-card {
        margin-top: -88px;
        border-radius: 26px;
        padding: 24px 20px 20px;
        box-shadow: 0 18px 34px rgba(32, 62, 112, 0.14);
        flex-shrink: 0;
    }

    .login-card__header h1 {
        font-size: 1.8rem;
    }

    .login-card__logo {
        display: block;
        width: min(120px, 56%);
        margin: 0 auto;
    }

    .login-footer {
        padding-top: 14px;
        padding-bottom: 0;
        flex-shrink: 0;
    }
}
