@charset "UTF-8";

@font-face {
	font-family: "Noto Sans KR";
	src: url(../../fonts/NotoSansCJKkr-Regular.otf);
}

/* ─── CSS Variables (Light Theme) ─── */
:root {
	--bg-primary: #f0f2f5;
	--bg-card: rgba(255, 255, 255, 0.85);
	--bg-card-border: rgba(255, 255, 255, 0.6);
	--bg-input: #f7f8fa;
	--bg-input-focus: #fff;
	--text-primary: #1a1a2e;
	--text-secondary: #64748b;
	--text-placeholder: #94a3b8;
	--border-color: #e2e8f0;
	--border-focus: #3b82f6;
	--accent: #3b82f6;
	--accent-hover: #2563eb;
	--accent-glow: rgba(59, 130, 246, 0.25);
	--error-color: #ef4444;
	--error-bg: rgba(239, 68, 68, 0.08);
	--shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
	--shadow-input: 0 1px 3px rgba(0, 0, 0, 0.04);
	--shadow-button: 0 4px 14px rgba(59, 130, 246, 0.35);
	--outline-color: #e2e8f0;
	--outline-hover: #cbd5e1;
	--gradient-start: #e0e7ff;
	--gradient-end: #f0f2f5;
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
	--bg-primary: #0f172a;
	--bg-card: rgba(30, 41, 59, 0.85);
	--bg-card-border: rgba(51, 65, 85, 0.6);
	--bg-input: #1e293b;
	--bg-input-focus: #273449;
	--text-primary: #f1f5f9;
	--text-secondary: #94a3b8;
	--text-placeholder: #64748b;
	--border-color: #334155;
	--border-focus: #60a5fa;
	--accent: #60a5fa;
	--accent-hover: #3b82f6;
	--accent-glow: rgba(96, 165, 250, 0.25);
	--error-color: #f87171;
	--error-bg: rgba(248, 113, 113, 0.1);
	--shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
	--shadow-input: 0 1px 3px rgba(0, 0, 0, 0.2);
	--shadow-button: 0 4px 14px rgba(96, 165, 250, 0.3);
	--outline-color: #334155;
	--outline-hover: #475569;
	--gradient-start: #1e293b;
	--gradient-end: #0f172a;
}

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

body, html {
	font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--text-primary);
	background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
	transition: background 0.4s ease, color 0.3s ease;
	min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, p, span {
	margin: 0;
	padding: 0;
	font: inherit;
}

a {
	text-decoration: none;
	color: var(--accent);
	transition: color 0.2s;
}

a:hover {
	color: var(--accent-hover);
}

button {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	box-sizing: border-box;
	cursor: pointer;
	border: none;
	outline: none;
}

input {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	box-sizing: border-box;
	outline: none;
}

/* ─── Hide default header/footer ─── */
#header-contents,
#footer-contents {
	display: none !important;
}

#main-contents {
	min-height: 100vh;
}

/* ─── Layout ─── */
.ptg-main {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 20px;
}

.ptg-main .ptg-w1200 {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	box-sizing: border-box;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ─── Card (Glassmorphism) ─── */
.user-auth-form {
	width: 100%;
	max-width: 440px;
	padding: 48px 40px;
	background: var(--bg-card);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--bg-card-border);
	border-radius: 20px;
	box-shadow: var(--shadow-card);
	transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
	animation: fadeSlideUp 0.5s ease-out;
	position: relative;
}

@keyframes fadeSlideUp {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── Auth Title (공통) ─── */
.auth-title {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin-bottom: 36px;
}

.auth-title .auth-icon {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--accent), var(--accent-hover));
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	box-shadow: var(--shadow-button);
}

.auth-title .auth-icon svg {
	width: 28px;
	height: 28px;
	color: #fff;
}

.auth-title .auth-icon .svgico {
	width: 28px;
	height: 28px;
	color: #fff;
}

[data-theme="dark"] .auth-title .auth-icon {
	background: linear-gradient(135deg, var(--accent), #818cf8);
	box-shadow: 0 4px 20px rgba(96, 165, 250, 0.4);
}

.auth-title h1 {
	font-size: 20px;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
}

.auth-title p {
	margin-top: 6px;
	font-size: 14px;
	color: var(--text-secondary);
}

/* ─── Floating Label Input Group (공통) ─── */
.input-group {
	position: relative;
	margin-bottom: 16px;
}

.input-group .ptg-input {
	display: block;
	width: 100%;
	height: 52px;
	padding: 16px 16px 8px;
	border: 1.5px solid var(--border-color);
	border-radius: 12px;
	font-size: 15px;
	color: var(--text-primary);
	background: var(--bg-input);
	box-shadow: var(--shadow-input);
	transition: all 0.25s ease;
}

.input-group .ptg-input:focus {
	border-color: var(--border-focus);
	background: var(--bg-input-focus);
	box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group .ptg-input::placeholder {
	color: transparent;
}

.input-group .floating-label {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 15px;
	color: var(--text-placeholder);
	pointer-events: none;
	transition: all 0.2s ease;
	background: transparent;
	padding: 0 2px;
}

.input-group .ptg-input:focus ~ .floating-label,
.input-group .ptg-input:not(:placeholder-shown) ~ .floating-label {
	top: 8px;
	transform: translateY(0);
	font-size: 11px;
	color: var(--border-focus);
	letter-spacing: 0.02em;
}

/* ─── Password Toggle (공통) ─── */
.input-group-pw {
	position: relative;
}

.input-group-pw .ptg-input {
	padding-right: 48px;
}

.pw-toggle {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--text-placeholder);
	font-size: 18px;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	transition: color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pw-toggle:hover {
	color: var(--text-secondary);
}

/* ─── Helper / Error Message (공통) ─── */
.input-helper {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	margin-top: -8px;
	margin-bottom: 16px;
	color: var(--text-secondary);
	font-size: 12px;
	border-radius: 8px;
}

.input-error {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	margin-top: -8px;
	margin-bottom: 16px;
	color: var(--error-color);
	background: var(--error-bg);
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	animation: shake 0.4s ease;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-6px); }
	40% { transform: translateX(6px); }
	60% { transform: translateX(-4px); }
	80% { transform: translateX(4px); }
}

/* ─── Auth Button (공통) ─── */
.auth-actions {
	display: flex;
	gap: 10px;
	margin-top: 28px;
}

.auth-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	font-size: 16px;
	font-weight: 600;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.25s ease;
	letter-spacing: -0.01em;
}

.auth-btn-primary {
	color: #fff;
	background: linear-gradient(135deg, var(--accent), var(--accent-hover));
	box-shadow: var(--shadow-button);
}

.auth-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px var(--accent-glow);
}

.auth-btn-primary:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px var(--accent-glow);
}

.auth-btn-secondary {
	color: var(--text-secondary);
	background: transparent;
	border: 1.5px solid var(--outline-color);
}

.auth-btn-secondary:hover {
	border-color: var(--outline-hover);
	color: var(--text-primary);
	background: var(--bg-input);
}

/* 주 동작 버튼만 남아 한 줄을 혼자 쓰는 경우(이동은 아래 링크 그룹이 맡습니다). */
.auth-btn-single {
	width: 100%;
	margin-top: 28px;
}

/* 발송에 성공하면 안내와 버튼이 사라져 입력 도움말이 폼의 마지막 요소가 됩니다 —
   아래 결과 영역의 위 여백과 겹치므로 자기 아래 여백은 지웁니다. */
form .input-helper:last-child {
	margin-bottom: 0;
}

/* 결과 영역이 주 동작 버튼에 붙지 않도록 띄웁니다.
   th:block 은 렌더되지 않으므로 결과의 첫 요소가 form 의 바로 다음 형제가 됩니다. */
form + .auth-notice,
form + .auth-result-list {
	margin-top: 24px;
}

/* ─── Divider (로그인 화면과 동일) ─── */
.login-divider {
	display: flex;
	align-items: center;
	margin: 28px 0 20px;
}

.login-divider::before,
.login-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border-color);
	transition: background 0.3s;
}

.login-divider span {
	padding: 0 14px;
	font-size: 12px;
	color: var(--text-placeholder);
	white-space: nowrap;
}

/* 결과 블록(안내·목록) 바로 뒤에 오는 구분선은 결과의 아래 여백과 겹치므로 위 여백을 줄입니다. */
.auth-notice + .login-divider,
.auth-result-list + .login-divider,
.input-helper + .login-divider {
	margin-top: 8px;
}

/* ─── Link Group (로그인 화면과 동일) ─── */
/* 보조 동작은 주 동작보다 가볍게 — 테두리 없는 텍스트 링크 한 줄 + 가운데 구분선. */
.link-group {
	width: 100%;
}

.link-group .link-row {
	display: flex;
	align-items: center;
	justify-content: center;
}

.link-group .link-row > a {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	font-size: 14px;
	font-weight: 500;
	color: var(--text-secondary);
	background: transparent;
	border-radius: 10px;
	transition: all 0.2s ease;
}

.link-group .link-row > a:hover {
	color: var(--text-primary);
	background: var(--bg-input);
}

.link-group .link-row > a .svgico {
	width: 16px;
	height: 16px;
}

.link-group .link-sep {
	flex: 0 0 auto;
	width: 1px;
	height: 14px;
	background: var(--border-color);
}

/* ─── Auth Footer (공통) ─── */
.auth-footer {
	margin-top: 32px;
	text-align: center;
	font-size: 12px;
	color: var(--text-placeholder);
}

/* ─── Notice ─── */
.auth-notice {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	margin-bottom: 24px;
	background: rgba(251, 191, 36, 0.1);
	border: 1px solid rgba(251, 191, 36, 0.3);
	border-radius: 12px;
	font-size: 13px;
	font-weight: 500;
	color: #f59e0b;
}

[data-theme="dark"] .auth-notice {
	background: rgba(251, 191, 36, 0.08);
	border-color: rgba(251, 191, 36, 0.2);
	color: #fbbf24;
}

.auth-notice svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.auth-notice .svgico {
	width: 18px;
	height: 18px;
}

/* 결과 안내 — 경고(주황)와 구분되도록 강조색 톤을 씁니다. */
.auth-notice-result {
	background: var(--accent-glow);
	border-color: var(--border-focus);
	color: var(--accent-hover);
}

[data-theme="dark"] .auth-notice-result {
	background: var(--accent-glow);
	border-color: var(--border-focus);
	color: var(--accent);
}

/* ─── Result badge / list (아이디 찾기) ─── */
/* 상태·구분 라벨. 결과 안내 안과 목록 항목 양쪽에서 씁니다. */
.auth-badge {
	flex-shrink: 0;
	margin-left: auto;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
	white-space: nowrap;
	border: 1px solid var(--border-color);
	color: var(--text-secondary);
	background: var(--bg-input);
}

.auth-badge-role {
	border-color: var(--border-focus);
	color: var(--accent-hover);
	background: var(--accent-glow);
}

/* 공유 닉네임 안내는 아이콘 + 문장이라 상단 정렬이 자연스럽습니다. */
.auth-notice-list {
	align-items: flex-start;
	line-height: 1.6;
}

.auth-result-list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	overflow: hidden;
}

.auth-result-item {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	padding: 10px 14px;
	font-size: 13px;
	color: var(--text-primary);
}

.auth-result-item + .auth-result-item {
	border-top: 1px solid var(--border-color);
}

.auth-result-id {
	font-weight: 500;
	word-break: break-all;
}

.auth-result-tags {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

/* 목록 안에서는 태그 묶음이 오른쪽 정렬을 맡습니다. */
.auth-result-tags .auth-badge {
	margin-left: 0;
}

/* ─── Server Error (로그인 화면과 같은 톤) ─── */
.ptg-input-error {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	margin-bottom: 8px;
	color: var(--error-color);
	background: var(--error-bg);
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	animation: shake 0.4s ease;
}

.ptg-input-error svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.ptg-input-error .svgico {
	width: 16px;
	height: 16px;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
	.user-auth-form {
		padding: 36px 24px;
		border-radius: 16px;
		max-width: 100%;
	}

	.auth-title .auth-icon {
		width: 48px;
		height: 48px;
	}

	.auth-title {
		margin-bottom: 28px;
	}

	.auth-actions {
		flex-direction: column-reverse;
	}
}