/* ================================================================
   Auth Pages (login.php / signup.php) Styles
================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Pretendard', -apple-system, sans-serif;
    background: #080808;
    color: #fff;
}

/* ----------------------------------------------------------------
   Page Layout
---------------------------------------------------------------- */
.auth-main {
    position: fixed;
    top: 90px;    /* 헤더 높이 */
    left: 0;
    right: 0;
    bottom: 80px; /* 푸터 영역 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    text-align: center;
    overflow-y: auto;
}

/* signup은 콘텐츠가 많아 상단 시작 + 스크롤 */
.auth-main--signup {
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* ----------------------------------------------------------------
   Container Width
---------------------------------------------------------------- */
.auth-container--wide {
    max-width: 960px;
}

/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
   회원 유형 선택 버튼 (직사각형)
---------------------------------------------------------------- */
.auth-type-select {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    justify-content: center;
}
.auth-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    user-select: none;
    padding: 12px 40px;
    border: 1.5px solid rgba(255,255,255,0.2);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    letter-spacing: 0.04em;
}
.auth-type-option + .auth-type-option {
    margin-left: -1px;
}
.auth-type-option:hover {
    color: rgba(255,255,255,0.8);
}
.auth-type-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* 선택 시: 배경 #ff2c2c */
.auth-type-option:has(input:checked) {
    background: #ff2c2c;
    border-color: #ff2c2c;
    color: #fff;
}

/* ----------------------------------------------------------------
   폼 섹션
---------------------------------------------------------------- */
.auth-form-section {
    padding-top: 24px;
    margin-bottom: 0;
}
.auth-form-section + .auth-form-section {
    border-top: 1px solid rgba(255,255,255,0.15);
}

/* 상세주소: 주소 선택 전에도 동일 스타일 */
.auth-detail-input[readonly] {
    cursor: not-allowed;
}
.auth-detail-input:not([readonly]) {
    cursor: text;
}
.auth-field-row { margin-bottom: 24px; }
.auth-field-row--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.auth-field-row--3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

/* 필수 표시 (contact 페이지 방식: 위 첨자) */
.req {
    color: #ff2c2c;
    font-size: 12px;
    vertical-align: super;
    margin-left: 2px;
    font-weight: 700;
}

/* 파일 첨부 */
.auth-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 13px 16px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}
.auth-file-label:hover { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.9); }
.auth-file-label.file-selected { color: #fff; }

/* 사업자등록증 첨부 아래 구분선 */
.auth-biz-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 20px 0;
}

/* 인라인 버튼 (중복확인 / 주소검색) */
.auth-inline-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    color: #888;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
    margin-left: 8px;
    letter-spacing: 0.03em;
}
.auth-inline-btn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.auth-inline-btn:disabled { opacity: 0.4; cursor: default; }

/* 아이디 입력 + 버튼 + 상태 래퍼 */
.auth-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.auth-input-row {
    display: flex;
    align-items: center;
}

/* 상태 메시지 (중복 확인 결과) */
.auth-field-status {
    font-size: 12px;
    padding-left: 2px;
    min-height: 1em;
}
.auth-field-status.ok  { color: #5de08a; }
.auth-field-status.err { color: #ff6b6b; }

@media (max-width: 700px) {
    .auth-field-row--2col,
    .auth-field-row--3col { grid-template-columns: 1fr; }
    .auth-main--signup { padding-top: 24px; }
    .auth-field label { min-width: 80px; }
}

/* 로그인 페이지: 라벨 고정 너비로 입력박스 시작점 정렬 */
body.page-login .auth-field label {
    min-width: 72px;
}

/* 로그인 페이지: 푸터 항상 표시 (fixed) */
body:not(.page-signup) .auth-main ~ .page-footer {
    position: fixed !important;
    bottom: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ----------------------------------------------------------------
   Signup 페이지: 일반 플로우 (스크롤 가능)
---------------------------------------------------------------- */
body.page-signup .auth-main {
    position: static !important;
    top: auto; left: auto; right: auto; bottom: auto;
    overflow: visible;
    padding: 110px 20px 60px;
    align-items: center;
    min-height: unset;
}

/* signup 푸터: 콘텐츠 아래 자연 위치 */
body.page-signup .page-footer {
    position: static !important;
    bottom: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: none !important;
}

/* ----------------------------------------------------------------
   Container
---------------------------------------------------------------- */
.auth-container {
    width: 100%;
    max-width: 640px;
}
.auth-container--login {
    max-width: 420px;
}

/* ----------------------------------------------------------------
   Header
---------------------------------------------------------------- */
.auth-header {
    margin-bottom: 40px;
    text-align: center;
}

.auth-header h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.1;
}

.auth-header p {
    font-size: 18px;
    opacity: 0.7;
    line-height: 1.6;
    color: #aaa;
}

/* ----------------------------------------------------------------
   Error / Success
---------------------------------------------------------------- */
.auth-error {
    background: rgba(255, 44, 44, 0.1);
    border: 1px solid rgba(255, 44, 44, 0.3);
    color: #ff6b6b;
    font-size: 14px;
    padding: 14px 16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-success {
    background: rgba(44, 200, 100, 0.08);
    border: 1px solid rgba(44, 200, 100, 0.25);
    color: #5de08a;
    font-size: 14px;
    padding: 14px 16px;
    margin-bottom: 24px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-success-link {
    color: #5de08a;
    font-weight: 700;
    text-decoration: underline;
    font-size: 13px;
}

/* ----------------------------------------------------------------
   Form
---------------------------------------------------------------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 28px;
}

/* 라벨 | 인풋 나란히 (contact 스타일) */
.auth-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.auth-field label {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
    margin-right: 10px;
    margin-bottom: 0;
    text-align: left;
}

/* 파일 첨부는 세로 유지 */
.auth-field--file {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.auth-field--file > label:first-child {
    min-width: unset;
    margin-right: 0;
}

.auth-field input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    border-radius: 0;
    padding: 12px 0;
    font-size: 15px;
    font-family: inherit;
    color: #fff;
    outline: none;
    transition: border-bottom-color 0.2s;
}

.auth-field input::placeholder { color: #3a3a3a; }
.auth-field input:focus { border-bottom-color: #ff2c2c; }

/* ----------------------------------------------------------------
   Submit Button
---------------------------------------------------------------- */
.auth-btn {
    width: 100%;
    padding: 16px;
    background: #ff2c2c;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
.auth-btn:hover { background: #e01f1f; }

/* ----------------------------------------------------------------
   Footer Links
---------------------------------------------------------------- */
.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
    margin-top: 20px;
}

.auth-footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.auth-footer-links a:hover { color: #fff; }

/* ----------------------------------------------------------------
   Mobile
---------------------------------------------------------------- */
@media (max-width: 600px) {
    .auth-back { top: 20px; left: 20px; }
    .auth-header h1 { font-size: 32px; }
    .auth-header p { font-size: 15px; }
}
