/* ================================================
   register.css — 회원가입 페이지 스타일
   login.css 의 디자인 토큰·패턴과 일관성 유지
   main.css, login.css 이후에 로드
   ================================================ */


/* ── Page Layout ── */
.register-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: calc(106px + 1rem) 0.75rem 2rem;

    background-color: #f0f2f5;
    background-image:
            repeating-linear-gradient(
                    90deg,
                    rgba(0, 0, 0, 0.03) 0px,
                    rgba(0, 0, 0, 0.03) 1px,
                    transparent 1px,
                    transparent 60px
            ),
            repeating-linear-gradient(
                    0deg,
                    rgba(0, 0, 0, 0.03) 0px,
                    rgba(0, 0, 0, 0.03) 1px,
                    transparent 1px,
                    transparent 60px
            ),
            radial-gradient(ellipse 60% 50% at 90%  5%,  rgba(200, 210, 230, 0.55) 0%, transparent 70%),
            radial-gradient(ellipse 50% 45% at  5% 95%,  rgba(180, 195, 220, 0.45) 0%, transparent 65%),
            radial-gradient(ellipse 80% 60% at 50% 50%,  rgba(220, 225, 235, 0.70) 0%, transparent 80%),
            linear-gradient(125deg, #e8eaf0 0%, #f5f6fa 40%, #eceef3 70%, #f0f2f7 100%);
    background-attachment: fixed;
}

/* ── Container ── */
.register-container {
    width: 100%;
    max-width: 32rem;           /* 로그인(28rem)보다 약간 넓게 — 필드가 많음 */
}

/* ── Card ── */
.register-card {
    background-color: var(--color-surface-container-lowest);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(196, 197, 214, 0.30);
}

@media (min-width: 768px) {
    .register-card { padding: 2.5rem; }
}

/* ── Card Header ── */
.register-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.register-header__title {
    font-family: var(--font-headline);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.025em;
}

/* ── Form ── */
.register-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Form Row (Field) ── */
.register-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.register-field__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-outline);
}

.register-field__required {
    color: #ba1a1a;
    margin-left: 0.2rem;
}

/* ── Input with Icon ── */
.register-field__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.register-field__input-wrap i {
    position: absolute;
    left: 0.875rem;
    color: var(--color-outline-variant);
    font-size: 1rem;
    pointer-events: none;
    user-select: none;
}

.register-field__input {
    width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 2.5rem;
    background-color: var(--color-surface-container-low);
    border: none;
    border-bottom: 2px solid var(--color-outline-variant);
    outline: none;
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--color-on-surface);
    transition: border-color 0.3s, background-color 0.3s;
}

.register-field__input::placeholder {
    color: rgba(116, 118, 133, 0.55);
}

.register-field__input:focus {
    border-bottom-color: var(--color-primary);
    background-color: var(--color-surface-container-lowest);
}

/* ── Field Error Message ── */
.register-field__error {
    font-size: 0.75rem;
    color: #ba1a1a;
    margin-top: 0.2rem;
}

/* ── ID 중복확인 행 ── */
.register-field__row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

.register-field__check-result {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.375rem;
    min-height: 1rem;
}

.register-field__check-result--ok  { color: #1a7a1a; }
.register-field__check-result--err { color: #ba1a1a; }

/* ── 중복확인 버튼 ── */
.btn-check {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    background-color: var(--color-surface-container-low);
    border: 1px solid var(--color-outline-variant);
    border-radius: var(--radius-lg);
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-check:hover {
    background-color: var(--color-surface-container-high);
    border-color: var(--color-primary);
}

/* ── 이용약관 링크 버튼 ── */
.btn-terms {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(22, 69, 184, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.btn-terms:hover {
    text-decoration-color: var(--color-primary);
}

/* ── 이용약관 동의 체크박스 행 ── */
.register-agree {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.register-agree__input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.register-agree__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-on-surface-variant);
    cursor: pointer;
}

/* ── 가입하기 버튼 ── */
.btn-submit-register {
    width: 100%;
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 47, 143, 0.20);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-submit-register:hover  { background-color: var(--color-primary-container); }
.btn-submit-register:active { transform: scale(0.98); }

/* ── 구분선 ── */
.register-divider {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0.25rem 0;
}

.register-divider::before,
.register-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid rgba(196, 197, 214, 0.40);
}


/* ── 모달 Overlay ── */
.register-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.register-modal.is-open {
    display: flex;
}

/* ── 모달 컨텐츠 박스 ── */
.register-modal__content {
    position: relative;
    background-color: var(--color-surface-container-lowest);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.30);
    width: 100%;
    max-width: 38rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.register-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(196, 197, 214, 0.40);
    flex-shrink: 0;
}

.register-modal__title {
    font-family: var(--font-headline);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-on-surface);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.register-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    color: var(--color-outline);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1;
}

.register-modal__close:hover {
    background-color: var(--color-surface-container-high);
    color: var(--color-on-surface);
}

.register-modal__body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--color-on-surface-variant);
}

/* 약관 본문 타이포그래피 */
.register-modal__body h2 {
    font-family: var(--font-headline);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 1.25rem 0 0.5rem;
}

.register-modal__body h2:first-child { margin-top: 0; }

.register-modal__body h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-on-surface);
    margin: 1rem 0 0.375rem;
}

.register-modal__body p {
    margin-bottom: 0.625rem;
}

.register-modal__body ol,
.register-modal__body ul {
    padding-left: 1.25rem;
    margin-bottom: 0.625rem;
}

.register-modal__body li { margin-bottom: 0.25rem; }


/* ── 푸터 (로그인으로 돌아가기) ── */
.register-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.register-footer__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.register-footer__link:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.50);
}


/* ================================================
   Mobile — 480px 이하
   ================================================ */
@media (max-width: 480px) {

    .register-page {
        align-items: flex-start;
        padding: calc(106px + 1rem) 0.75rem 2.5rem;
        background-attachment: scroll;
    }

    .register-container {
        max-width: 100%;
    }

    .register-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius-lg);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
    }

    .register-header__title {
        font-size: 1.375rem;
    }

    .register-form {
        gap: 1rem;
    }

    /* iOS 자동 줌 방지 (16px 이상) */
    .register-field__input {
        font-size: 1rem;
        padding: 0.9375rem 1rem 0.9375rem 2.5rem;
    }

    .btn-check {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .btn-submit-register {
        padding: 1rem;
        font-size: 1rem;
    }

    /* 모달 풀화면 대응 */
    .register-modal__content {
        max-height: 92vh;
        border-radius: var(--radius-lg);
    }

    .register-modal__body {
        font-size: 0.75rem;
    }

    /* 탭 하이라이트 제거 */
    .btn-check,
    .btn-terms,
    .btn-submit-register,
    .register-agree__input,
    .register-modal__close {
        -webkit-tap-highlight-color: transparent;
    }
}


/* 비밀번호변경 모달 */
/* Modal Styles */
.modal-open {
    overflow: auto !important;
}
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: 0;
    padding: 20px;
    border: 1px solid #888;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.2s ease;
}

/* 애니메이션 */
@keyframes modalFadeIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* =========================
   Password Modal
========================= */

/* 모달 박스 */
#passwordModal .modal-dialog {
    display: flex;
    flex-direction: column;
    margin: 0;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.2s ease;
}

/* 상단 타이틀 */
.modal-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #1645B8;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.modal-title-bar i {
    margin-right: 6px;
}

/* 닫기 버튼 */
.close-button {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

.close-button:hover {
    opacity: 1;
}

/* 본문 */
.modal-content {
    padding: 20px 18px;
}

/* 폼 row */
.form-row {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

/* label */
.form-row label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

/* input + icon */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

/* input */
.input-with-icon input {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border: none;
    border-bottom: 2px solid #ddd;
    outline: none;
    font-size: 14px;
    transition: 0.2s;
}

.input-with-icon input:focus {
    border-bottom-color: #1645B8;
}

/* 버튼 */
.btn-submit {
    width: 100%;
    padding: 12px;
    background: #1645B8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submit:hover {
    background: #0f3a99;
}

/* 애니메이션 */
@keyframes modalFadeIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}