:root {
    --page-bg: #ffffff;
    --surface: #f7fafc;
    --surface-alt: #e8edf2;
    --border: #cfdbe8;
    --text-strong: #0d141c;
    --text-muted: #4d7399;
    --brand: #1280ed;
    --white: #ffffff;
    --radius: 8px;
    --container-max: 960px;
    --form-max: 520px;
    --gap-lg: 20px;
    --gap-md: 16px;
    --gap-sm: 12px;
    --pad-x: 16px;

    --seg-radius: var(--radius);
    --seg-primary: var(--brand);
    --seg-border: var(--border);
    --seg-text: var(--text-strong);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-strong);
    font-family: "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.5;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

.section {
    padding: 20px 0;
}

/* 로그인 레이아웃: signup과 동일하게 중앙 정렬 */
.section-intro-login {
    min-height: calc(100vh - 160px); /* header/footer 높이에 따라 유지 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.section-intro-login__container {
    width: 100%;
    max-width: var(--form-max); /* signup의 form-max로 통일 */
}

/* 카드: signup의 input 배경/보더톤과 맞춤 */
.intro-login-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px); /* signup radius 기반으로 살짝만 확대 */
    padding: 24px;
    box-shadow: 0 8px 24px rgba(13, 20, 28, 0.06);
}

/* 헤더 타이포: signup 헤더와 톤 맞춤 */
.intro-login-card__header {
    margin-bottom: 14px;
    text-align: center;
}

.intro-login-card__title {
    margin: 0 0 8px 0;
    font-size: 28px;
    line-height: 35px;
    font-weight: 700; /* signup과 동일 */
    letter-spacing: -0.4px;
}

.intro-login-card__desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* 알림 */
.intro-login-alert {
    border-radius: var(--radius);
    padding: 12px 12px;
    font-size: 14px;
    line-height: 1.4;
    margin: 14px 0 12px;
}

.intro-login-alert--error {
    background: #fff1f1;
    border: 1px solid #ffd6d6;
    color: #b42318;
}

/* 폼: signup의 field 구조와 동일한 느낌 */
.intro-login-form {
    display: grid;
    gap: 8px;
}

.intro-login-form__group {
    display: grid;
    gap: 6px;
    margin: 0; /* 기존 margin 제거 */
}

/* label은 signup에서는 숨겼는데, 로그인은 보여도 됨. 대신 톤만 통일 */
.intro-login-form__label {
    display: block;
    font-size: 13px;
    color: var(--text-strong);
    font-weight: 600;
    margin: 0 0 2px 2px;
}

/* input: signup의 input 톤으로 통일 */
.intro-login-form__input {
    width: 100%;
    min-height: 48px; /* signup과 동일 */
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-alt); /* signup과 동일 */
    color: var(--text-strong);
    font: inherit;
    outline: 0;
}

.intro-login-form__input::placeholder {
    color: var(--text-muted);
}

.intro-login-form__input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(18, 128, 237, 0.15);
}

/* 비밀번호 보기: signup의 input-with-icon 구조 그대로 */
.intro-login-form__password {
    position: relative;
}

.intro-login-form__input--password {
    padding-right: 48px;
}

/* 버튼을 span 토글 방식으로 바꿔도 되지만, 현재 구조(button) 유지하면서 시각만 맞춤 */
.intro-login-form__toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent; /* signup 토글처럼 배경 제거 */
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    padding: 0;
}

.intro-login-form__toggle:active {
    transform: translateY(calc(-50% + 1px));
}

/* 옵션 row */
.intro-login-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 10px;
}

.intro-login-form__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
}

/* signup의 체크박스 커스텀과 통일 */
.intro-login-form__check input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    background: #fff;
    margin: 0;
}

.intro-login-form__check input[type="checkbox"]:checked {
    background: var(--brand);
    border-color: var(--brand);
}

.intro-login-form__check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    width: 6px;
    height: 12px;
    border: solid #f7fafc;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.intro-login-form__link {
    font-size: 13px;
    color: var(--brand);
    text-decoration: underline;
    font-weight: 600;
}

.intro-login-form__link:hover {
    color: #0b66c3;
}

/* 버튼: signup submit-button 스타일과 동일 */
.btn-intro-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #f7fafc;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.btn-intro-primary:hover {
    filter: brightness(1.05);
}

.btn-intro-primary:active {
    filter: brightness(0.95);
}

/* 푸터 */
.intro-login-card__footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e8eb;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center; /* signup 톤 */
}

.intro-login-card__footer-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.intro-login-card__footer-link {
    color: var(--brand);
    text-decoration: underline;
    font-weight: 700;
}

.intro-login-card__footer-link:hover {
    color: #0b66c3;
}

.intro-login-card__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-strong);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

/* 브라우저 기본 아이콘 숨김 (signup과 동일) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

/* 반응형 */
@media (max-width: 640px) {
    .intro-login-card__title {
        font-size: 24px;
        line-height: 32px;
    }
}

/* ---------------- Password Help Modal ---------------- */
.pw-modal[hidden] {
    display: none;
}

.pw-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;      /* 세로 중앙 */
    justify-content: center;  /* 가로 중앙 */
}

.pw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 0;
}

.pw-modal__panel {
    position: relative;
    max-width: 720px;
    width: 100%;
    margin: 0;           
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
}

.pw-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.pw-modal__title {
    margin: 0;
    padding: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pw-modal__body {
    padding: 18px;
    max-height: 520px;
    overflow: auto;
}

.pw-modal__footer {
    padding: 14px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.pw-modal__close {
    all: unset;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}