@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

.login-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #F5F3F2;
    color: #333333;
    font-family: "Noto Sans JP", sans-serif;
}

.login-header {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 96px;
    padding: 0 clamp(24px, 5.5vw, 52px);
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.login-header a,
.login-header img {
    display: block;
}

.login-header img {
    width: 125px;
    height: auto;
}

.login-main {
    display: flex;
    flex: 1 1 0%;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    padding: 40px 16px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.login-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    min-height: 364px;
    padding: 40px;
    border-radius: 8px;
    background: #fff;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    width: max-content;
    color: #333333;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0;
    text-align: center;
}

.login-input {
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    outline: none;
    background: #fff;
    color: #333333;
    font: inherit;
    font-size: 16px;
    line-height: 24px;
    transition: border-color 120ms ease;
}

.login-input:focus {
    border-color: #4DA31F;
}

.login-input--invalid,
.login-input--invalid:focus {
    border-color: #C7233B;
}

.login-field-error {
    margin: 0;
    color: #C7233B;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0;
}

.login-field-error[hidden] {
    display: none;
}

.login-password-wrap {
    position: relative;
}

.login-password-input {
    padding-right: 48px;
}

.login-password-input--masked {
    overflow: hidden;
    color: transparent;
    caret-color: transparent;
    -webkit-text-fill-color: transparent;
}

.login-password-mask {
    position: absolute;
    top: 0;
    right: 48px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    overflow: hidden;
    pointer-events: none;
}

.login-password-mask[hidden] {
    display: none;
}

.login-password-mask__dot {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333333;
}

.login-password-mask__caret {
    position: absolute;
    top: 10px;
    left: max(1px, calc(var(--caret-index) * 20px - 2px));
    width: 1px;
    height: 20px;
    background: #333333;
    animation: login-password-mask-caret-blink 1s step-end infinite;
}

@keyframes login-password-mask-caret-blink {
    50% {
        opacity: 0;
    }
}

.login-password-visibility {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 48px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b9b9b9;
    cursor: pointer;
}

.login-password-visibility:hover {
    color: #555;
}

.login-password-visibility:focus-visible,
.login-submit:focus-visible,
.login-links a:focus-visible {
    outline: none;
}

.login-eye-icon {
    display: block;
    width: 16px;
    height: auto;
}

.login-eye-icon--hidden {
    display: none;
}

.login-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin-top: 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 4px;
    background: #4DA31F;
    color: #fff;
    font: inherit;
    font-size: 18px;
    line-height: 28px;
    font-weight: 700;
    cursor: pointer;
}

.login-submit:hover {
    background: #438f1b;
}

.login-links {
    display: grid;
    align-items: center;
    gap: 24px;
    margin-top: 0;
}

.login-links a {
    color: #003ace;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0;
    text-align: center;
    text-decoration: underline;
    text-decoration-style: solid;
    text-underline-offset: 0;
    text-decoration-thickness: auto;
}

.login-alert {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #C7233B;
    border-radius: 4px;
    color: #333333;
    font-size: 14px;
    line-height: 20px;
}

.login-alert[hidden] {
    display: none;
}

.login-alert--error {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    gap: 8px;
    background: #F9E7E9;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0;
}

.login-alert--error p {
    min-width: 0;
    margin: 0;
}

.login-alert__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #C7233B;
}

.login-alert__messages {
    min-width: 0;
}

.login-alert__messages p + p {
    margin-top: 4px;
}

.login-alert--status {
    border-color: #4DA31F;
}

.login-alert--warning {
    border-color: #b67812;
}

.login-layout .footer-m {
    flex: 0 0 auto;
    margin-top: auto;
}

@media (max-width: 767px) {
    .login-header {
        height: 64px;
        padding: 0 20px;
    }

    .login-header img {
        width: 112px;
    }

    .login-main {
        padding: 24px 16px;
    }

    .login-panel {
        max-width: 327px;
    }

    .login-alert--error {
        height: 62px;
        font-size: 14px;
        line-height: 20px;
    }

    .login-card {
        max-width: 327px;
        min-height: 328px;
        padding: 24px;
    }

    .login-field label {
        font-size: 14px;
        line-height: 20px;
    }

    .login-input {
        font-size: 14px;
        line-height: 20px;
    }

    .login-field-error {
        font-family: "Noto Sans JP", sans-serif;
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px;
        letter-spacing: 0;
    }

    .login-links a {
        font-size: 12px;
        line-height: 16px;
    }

    .login-submit {
        min-height: 48px;
        font-size: 16px;
        line-height: 24px;
    }
}

@media (max-height: 720px) {
    .login-main {
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-input {
        transition: none;
    }

    .login-password-mask__caret {
        animation: none;
    }
}
