/**
 * dy Custom Registration Page — 登入／註冊畫面
 * 色彩、尺寸取自 Figma「歡喜緣佛具店 / 會員登入」(461:12057)
 * 所有 class 皆以 .dycrp- 開頭，不覆蓋 WordPress 原生 .wp-* class
 */

/* ---------- 設計變數 ---------- */
.dycrp-auth {
	--dycrp-ink: #292421;            /* 主-木墨黑：文字、按鈕底色 */
	--dycrp-ink-60: rgba(41, 36, 33, .6);
	--dycrp-paper: #f2ead9;          /* 米：背景底色 */
	--dycrp-white: #fff;             /* 主-宣紙米白：按鈕文字 */
	--dycrp-red: #7c2f29;            /* 主-歡喜朱紅：忘記密碼、立即註冊 */
	--dycrp-gold: #b58a45;           /* 主-古銅金：連結光暈、按鈕 hover */
	--dycrp-font: "Noto Serif TC", serif;
}

/* ---------- 外層：撐滿整個視窗寬度（Astra / Elementor 內容區有最大寬度） ---------- */
/* 100vw 含捲軸寬度，body 與內容區都裁掉水平溢出，避免出現水平捲軸
 * （overflow-x: clip 不會建立捲動容器，不影響黏性頁首） */
body.dycrp-login-screen,
.dycrp-login-screen .site-content {
	overflow-x: clip;
}

.dycrp-login-screen .entry-header {
	display: none; /* 設計稿沒有「我的帳號」頁面標題 */
}

.dycrp-login-screen #primary,
.dycrp-login-screen .entry-content {
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
}

/* Elementor 版面：放登入區塊的容器去掉上下外距、內距、元件間距，
 * 水墨背景才能直接貼齊頁首與頁尾，不留白邊 */
.dycrp-login-screen .e-con:has(.dycrp-auth),
.dycrp-login-screen .e-con:has(.dycrp-auth) > .e-con-inner {
	--margin-top: 0px;
	--margin-bottom: 0px;
	--padding-top: 0px;
	--padding-bottom: 0px;
	--gap: 0px;
	--row-gap: 0px;
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
	gap: 0;
}

/* 同容器內的 Elementor 標題（例如「會員中心」）：設計稿沒有，登入畫面隱藏 */
.dycrp-login-screen .e-con:has(.dycrp-auth) .elementor-widget-heading {
	display: none;
}

.dycrp-login-screen .elementor-widget:has(.dycrp-auth) {
	margin: 0;
}

.dycrp-auth {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	background-color: var(--dycrp-paper);
	color: var(--dycrp-ink);
	font-family: var(--dycrp-font);
	font-size: 14px;
}

/* 水墨山水背景：原圖疊 40% 不透明度在米色上 */
.dycrp-auth::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background: var(--dycrp-bg) center / cover no-repeat;
	opacity: .4;
}

/* 背景漸變層：疊在最上層（z-index: 0），顏色與方向由後台 CSS 變數控制 */
.dycrp-auth::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: var(--dycrp-gradient, none);
	pointer-events: none;
}

/* 背景影片層：疊在水墨圖上（z-index: -1），不透明度由後台控制 */
.dycrp-bg-video {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: var(--dycrp-video-opacity, 0.1);
	pointer-events: none;
}

/* ---------- 裝飾雲紋（位置依 1920 寬設計稿換算為百分比） ---------- */
.dycrp-deco {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

.dycrp-deco__cloud {
	position: absolute;
	max-width: none;
	height: auto;
}

/* 雲朵圖檔為設計稿「畫面內可見的部分」，所以貼齊左右邊緣定位
 * 寬度依 1920 設計稿換算成百分比，垂直位置以區塊頂端計算 */
.dycrp-deco__cloud--top {
	top: 82px;
	left: 0;
	width: 17.14%;   /* 329 / 1920 */
}

.dycrp-deco__cloud--left {
	top: 758px;
	left: 0;
	width: 27.6%;    /* 530 / 1920 */
}

.dycrp-deco__cloud--right {
	top: 758px;
	right: 0;
	width: 9.43%;    /* 181 / 1920 */
}

/* ---------- 內容區 ---------- */
.dycrp-auth__inner {
	position: relative;
	z-index: 1; /* 確保在漸變層（::after z-index:0）上面 */
	max-width: 635px;
	margin: 0 auto;
	padding: 120px 16px;
	box-sizing: content-box;
}

.dycrp-panel[hidden] {
	display: none;
}

.dycrp-panel {
	display: flex;
	flex-direction: column;
	gap: 80px;
	animation: dycrp-fade .4s ease;
}

@keyframes dycrp-fade {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

/* WooCommerce 錯誤／成功訊息：限制在表單寬度內 */
.dycrp-auth__inner > .woocommerce-notices-wrapper,
.dycrp-auth__inner > .woocommerce-error,
.dycrp-auth__inner > .woocommerce-message,
.dycrp-auth__inner > .woocommerce-info {
	max-width: 418px;
	margin: 0 auto 40px;
	font-size: 16px;
}

/* ---------- 標題圖騰 ---------- */
.dycrp-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
}

.dycrp-emblem {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 408px;
	max-width: 100%;
}

/* 雲紋底圖：寬 449，中心比容器右偏 56px、比中線低 12.5px */
.dycrp-auth .dycrp-emblem__cloud {
	position: absolute;
	top: 52.9px;
	left: calc(50% - 168.5px);
	width: 449px;
	max-width: none;
	height: 250px;
	transform: scaleX(-1);
	z-index: 0;
}

.dycrp-emblem__en {
	position: relative;
	z-index: 1;
	margin: 0 0 -20px;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
	text-align: center;
	opacity: .4;
}

.dycrp-emblem__mark {
	position: relative;
	z-index: 1;
	width: 306px;
	height: 306px;
}

/* 水墨圓環（只有圓環的圖）：設計稿圓環 275.4，置中於 306 方框 */
.dycrp-auth .dycrp-emblem__ring {
	position: absolute;
	top: 15.3px;
	left: 15.3px;
	width: 275.4px;
	height: 275.4px;
	max-width: none;
}

/* 圓環圖已含標題文字（例如 Figma 匯出的 GIF 動畫）：
 * 依原圖比例、高 306 置中顯示，網頁上的標題文字只留給螢幕閱讀器 */
.dycrp-auth .dycrp-emblem--composite .dycrp-emblem__ring {
	top: 0;
	left: 50%;
	width: auto;
	height: 306px;
	transform: translateX(-50%);
}

.dycrp-auth .dycrp-emblem--composite .dycrp-emblem__title {
	clip-path: inset(50%);
	overflow: hidden;
}

/* 水墨圓環：進場後持續旋轉
 * 用獨立的 rotate 屬性，不會蓋掉含字圓環置中用的 transform */
.dycrp-auth .dycrp-emblem__ring {
	animation: dycrp-spin 8s linear infinite;
}

@keyframes dycrp-spin {
	from { rotate: 0deg; }
	to   { rotate: 360deg; }
}

/* 沒有圓環圖時（註冊面板尚未設定專用圖），只留標題文字 */
.dycrp-emblem--no-ring .dycrp-emblem__ring {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.dycrp-panel,
	.dycrp-auth .dycrp-emblem__ring {
		animation: none;
	}
}

/* 直書標題：「會員」32px、「登入」42px，每字一行 */
.dycrp-auth .dycrp-emblem__title {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	font-family: var(--dycrp-font);
	font-weight: 700;
	line-height: 1.4;
	color: var(--dycrp-ink);
	text-align: center;
}

.dycrp-emblem__small,
.dycrp-emblem__big {
	position: absolute;
	width: 1em;
	word-break: break-all;
}

.dycrp-emblem__small {
	top: 67px;
	left: 130px;
	font-size: 32px;
}

.dycrp-emblem__big {
	top: 104px;
	left: 172px;
	font-size: 42px;
}

/* 分隔線：左線 ＋ 蓮花 ＋ 右線 */
.dycrp-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.dycrp-auth .dycrp-divider__line {
	flex: 1 1 0;
	min-width: 0;
	height: 4px;
	object-fit: fill;
}

.dycrp-auth .dycrp-divider__lotus {
	flex: 0 0 49px;
	width: 100%;
	height: 39px;
}

/* ---------- 表單 ---------- */
.dycrp-form {
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 418px;
	max-width: 100%;
	margin: 0 auto;
}

.dycrp-fields {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* 只有底線的輸入框 */
.dycrp-auth .dycrp-field {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0;
	padding: 8px 0;
	border-bottom: 1px solid var(--dycrp-ink-60);
	transition: border-color .2s ease;
}

.dycrp-auth .dycrp-field:focus-within {
	border-bottom-color: var(--dycrp-ink);
}

.dycrp-field__icon {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	height: 46px;
	padding-left: 12px;
	margin: 0;
	cursor: text;
}

.dycrp-field__icon img {
	display: block;
	width: 20px;
	height: 20px;
}

/* 覆蓋佈景主題的輸入框外框、陰影、內距 */
.dycrp-auth .dycrp-field .dycrp-field__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	font-family: var(--dycrp-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--dycrp-ink);
}

.dycrp-auth .dycrp-field .dycrp-field__input::placeholder {
	color: var(--dycrp-ink-60);
	opacity: 1;
}

/* 鍵盤操作時仍要看得到焦點 */
.dycrp-auth .dycrp-field:has(.dycrp-field__input:focus-visible) {
	border-bottom-width: 2px;
}

/* 密碼顯示切換 */
.dycrp-auth .dycrp-field__eye {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	height: 46px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	opacity: .6;
	transition: opacity .2s ease;
}

.dycrp-auth .dycrp-field__eye:hover,
.dycrp-auth .dycrp-field__eye[aria-pressed="true"] {
	opacity: 1;
	background: transparent;
}

.dycrp-field__eye img {
	display: block;
	width: 20px;
	height: 20px;
}

.dycrp-note,
.dycrp-privacy {
	font-size: 14px;
	line-height: 1.6;
	color: var(--dycrp-ink);
	opacity: .7;
}

.dycrp-note {
	margin: 0;
}

.dycrp-privacy:empty {
	display: none;
}

.dycrp-privacy p {
	margin: 0;
}

/* ---------- 按鈕與連結 ---------- */
.dycrp-actions {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* 朱紅文字連結＋古銅金光暈 */
.dycrp-auth .dycrp-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 48px;
	font-family: var(--dycrp-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--dycrp-red);
	text-decoration: none;
}

.dycrp-auth .dycrp-link--glow {
	filter: drop-shadow(0 4px 20px var(--dycrp-gold));
}

.dycrp-auth .dycrp-link:hover,
.dycrp-auth .dycrp-link:focus-visible {
	color: var(--dycrp-red);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.dycrp-forgot {
	align-self: flex-start;
	padding: 4px 0;
}

/* 主要按鈕：外框 1px 木墨黑 → 4px 間距 → 木墨黑底＋白色細框 */
.dycrp-auth .dycrp-btn {
	display: block;
	width: 100%;
	margin: 0;
	padding: 4px;
	border: 1px solid var(--dycrp-ink);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}

.dycrp-btn__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 12px 24px;
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, .6);
	background: var(--dycrp-ink);
	font-family: var(--dycrp-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--dycrp-white);
	transition: background-color .2s ease;
}

.dycrp-auth .dycrp-btn:hover,
.dycrp-auth .dycrp-btn:focus {
	background: transparent;
}

.dycrp-auth .dycrp-btn:hover .dycrp-btn__inner,
.dycrp-auth .dycrp-btn:focus-visible .dycrp-btn__inner {
	background: var(--dycrp-gold);
}

/* 底部：還不是會員？ 立即註冊 → */
.dycrp-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 56px;
}

.dycrp-switch__text {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	opacity: .6;
}

.dycrp-switch__link {
	padding: 4px 0;
}

.dycrp-auth .dycrp-switch__arrow {
	width: 32px;
	height: 32px;
}

/* ---------- 手機版 ---------- */
@media (max-width: 768px) {
	.dycrp-auth__inner {
		padding: 64px 16px 80px;
	}

	.dycrp-panel {
		gap: 48px;
	}

	.dycrp-head {
		gap: 24px;
	}

	.dycrp-emblem__en {
		font-size: 24px;
		margin-bottom: -12px;
	}

	/* 左右兩朵雲在窄螢幕會壓到表單，隱藏 */
	.dycrp-deco__cloud--left,
	.dycrp-deco__cloud--right {
		display: none;
	}

	.dycrp-deco__cloud--top {
		top: 16px;
		width: 40%;
		opacity: .5;
	}

	.dycrp-auth .dycrp-field .dycrp-field__input,
	.dycrp-auth .dycrp-link,
	.dycrp-btn__inner,
	.dycrp-switch__text {
		font-size: 18px;
	}

	.dycrp-form {
		gap: 32px;
	}
}
