/* ==========================================================================
   CoCo Social Login — light split-screen auth
   Left: full-bleed carousel + top-left logo
   Right: form panel · Mobile: logo above form
   ========================================================================== */

:root {
	--csl-accent: #6366f1;
	--csl-accent-hover: #5855eb;
	--csl-accent-soft: rgba(99, 102, 241, 0.12);
	--csl-visual-dim: 0.08;
	--csl-bg-root: #f5f5f7;
	--csl-bg-form: #ffffff;
	--csl-text: #1d1d1f;
	--csl-text-muted: #6e6e73;
	--csl-border: #d2d2d7;
	--csl-radius-sm: 10px;
	--csl-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--csl-safe-top: env(safe-area-inset-top, 0px);
	--csl-safe-bottom: env(safe-area-inset-bottom, 0px);
	--csl-split-min: 1024px;
	--csl-split-brand: 36%;
	--csl-split-form: 64%;
}

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

html,
body.csl-auth-body {
	height: 100%;
	margin: 0;
	overflow: hidden;
}

body.csl-auth-body {
	font-family: var(--csl-font);
	background: var(--csl-bg-root);
	color: var(--csl-text);
	-webkit-font-smoothing: antialiased;
}

body.csl-auth-body .csl-auth-main {
	height: 100dvh;
	min-height: 100dvh;
	max-height: 100dvh;
	padding: 0;
	margin: 0;
	overflow: hidden;
	background: var(--csl-bg-root);
}

/* --------------------------------------------------------------------------
   Split shell
   -------------------------------------------------------------------------- */

.csl-auth-shell {
	display: grid;
	grid-template-columns: 1fr;
	height: 100dvh;
	max-height: 100dvh;
	overflow: hidden;
	background: var(--csl-bg-form);
}

.csl-auth-shell__brand {
	display: none;
}

.csl-auth-shell__form {
	display: flex;
	min-height: 0;
	min-width: 0;
	background: var(--csl-bg-form);
}

.csl-auth-shell__form-inner {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: calc(28px + var(--csl-safe-top)) 24px calc(28px + var(--csl-safe-bottom));
	overflow-y: auto;
	overscroll-behavior: contain;
}

.csl-auth-page__content {
	width: 100%;
	max-width: 400px;
}

.csl-auth-page__header {
	margin-bottom: 28px;
}

.csl-auth-page__title {
	margin: 0;
	font-size: clamp(24px, 4vw, 30px);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.03em;
	color: var(--csl-text);
}

/* Logo */
.csl-auth-logo {
	display: inline-block;
	line-height: 0;
	text-decoration: none;
}

.csl-auth-logo__image {
	display: block;
	width: auto;
	height: auto;
	max-width: min(180px, 42vw);
	max-height: 48px;
	min-height: 24px;
	object-fit: contain;
}

.csl-auth-logo--brand {
	display: none;
	position: relative;
	z-index: 5;
}

.csl-auth-logo--mobile {
	display: inline-block;
	margin-bottom: 24px;
}

.csl-auth-page__bind-note {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--csl-text-muted);
}

.csl-auth-page__verified-note {
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px solid var(--csl-border);
	border-radius: 10px;
	background: #f8fafc;
	font-size: 14px;
	line-height: 1.5;
	color: var(--csl-text);
}

.csl-auth-page__footer {
	margin: 22px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--csl-text-muted);
	text-align: center;
}

.csl-auth-page__footer a {
	color: var(--csl-accent);
	font-weight: 500;
	text-decoration: none;
}

.csl-auth-page__footer a:hover {
	text-decoration: underline;
}

/* Notices */
.csl-auth-notice {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: var(--csl-radius-sm);
	font-size: 14px;
	line-height: 1.5;
}

.csl-auth-notice--error {
	background: #fff5f5;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.csl-auth-notice--success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

/* Social */
.csl-social-login--before-form {
	margin: 0 0 18px;
}

.csl-social-login__buttons {
	display: grid;
	gap: 10px;
}

.csl-social-login__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 16px;
	border: 1px solid var(--csl-border);
	border-radius: var(--csl-radius-sm);
	background: #fff;
	color: var(--csl-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
}

.csl-social-login__btn:hover {
	border-color: #b8b8bd;
	background: #fafafa;
}

.csl-social-login__icon {
	display: inline-flex;
	flex-shrink: 0;
}

.csl-social-login__divider {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 14px;
	margin: 18px 0 0;
	color: var(--csl-text-muted);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.csl-social-login__divider::before,
.csl-social-login__divider::after {
	content: "";
	height: 1px;
	background: var(--csl-border);
}

/* Form */
.csl-auth-form .form-row {
	margin: 0 0 14px;
}

.csl-auth-form label {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 500;
	color: var(--csl-text);
}

.csl-auth-form__label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 7px;
}

.csl-auth-form__label-row label {
	margin-bottom: 0;
}

.csl-auth-form__inline-link {
	font-size: 13px;
	font-weight: 500;
	color: var(--csl-accent);
	text-decoration: none;
	white-space: nowrap;
}

.csl-auth-form__inline-link:hover {
	text-decoration: underline;
}

.csl-auth-form .em-input,
.csl-auth-form input[type="text"],
.csl-auth-form input[type="password"],
.csl-auth-form input[type="email"],
.csl-auth-form input[type="tel"] {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 12px 14px;
	border: 1px solid var(--csl-border);
	border-radius: var(--csl-radius-sm);
	background: #fff;
	color: var(--csl-text);
	font-size: 16px;
	-webkit-appearance: none;
	appearance: none;
}

.csl-auth-form .em-input:focus,
.csl-auth-form input:focus {
	outline: none;
	border-color: var(--csl-accent);
	box-shadow: 0 0 0 3px var(--csl-accent-soft);
}

.csl-auth-form .em-btn,
.csl-auth-form button[type="submit"],
.csl-auth-form .csl-auth-form__send-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 20px;
	border: none;
	border-radius: var(--csl-radius-sm);
	background: var(--csl-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.csl-auth-form .em-btn:hover,
.csl-auth-form button[type="submit"]:hover {
	background: var(--csl-accent-hover);
}

.csl-auth-form .em-btn--block,
.csl-auth-form button[type="submit"] {
	width: 100%;
}

.csl-auth-form .em-btn--outline,
.csl-auth-form .csl-auth-form__send-code {
	background: #fff;
	border: 1px solid var(--csl-border);
	color: var(--csl-text);
}

.csl-auth-form .em-btn--outline:hover,
.csl-auth-form .csl-auth-form__send-code:hover {
	border-color: #b8b8bd;
	background: #fafafa;
}

.csl-auth-form__actions {
	display: grid;
	gap: 12px;
	margin-top: 4px;
}

.csl-auth-form__remember {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--csl-text-muted);
	cursor: pointer;
}

.csl-auth-form__remember input {
	accent-color: var(--csl-accent);
}

.csl-auth-form__code-field {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.csl-auth-form__send-code[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Desktop — left full-bleed carousel (iPad landscape and up)
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
	.csl-auth-shell {
		grid-template-columns: var(--csl-split-brand) var(--csl-split-form);
	}

	.csl-auth-shell__brand {
		display: block;
		position: relative;
		min-height: 0;
		min-width: 0;
		overflow: hidden;
		background: #e8e8ed;
	}

	.csl-auth-logo--brand {
		display: inline-block;
		position: absolute;
		top: clamp(28px, 3vw, 40px);
		left: clamp(28px, 3vw, 40px);
		right: auto;
		z-index: 6;
		pointer-events: auto;
	}

	.csl-auth-logo--brand .csl-auth-logo__image {
		max-width: min(148px, 22vw);
		max-height: 38px;
		filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
	}

	.csl-auth-logo--mobile {
		display: none;
	}

	.csl-auth-shell__carousel {
		position: absolute;
		inset: 0;
		z-index: 1;
		width: 100%;
		height: 100%;
	}

	.csl-auth-shell__carousel .swiper-wrapper,
	.csl-auth-shell__carousel .swiper-slide {
		height: 100%;
	}

	.csl-auth-shell__carousel-slide {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
		overflow: hidden;
		background: #e8e8ed;
	}

	.csl-auth-shell__carousel-media {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		overflow: hidden;
		background: #e8e8ed;
	}

	.csl-auth-shell__carousel-slide::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 2;
		background: rgba(0, 0, 0, var(--csl-visual-dim));
		pointer-events: none;
	}

	.csl-auth-shell__carousel-image {
		position: relative;
		z-index: 1;
		display: block;
		width: auto;
		height: auto;
		max-width: 100%;
		max-height: 100%;
		object-fit: contain;
		object-position: center center;
	}

	.csl-auth-shell__carousel-nav {
		position: absolute;
		right: 20px;
		bottom: 20px;
		z-index: 3;
		display: inline-flex;
		gap: 8px;
	}

	.csl-auth-shell__carousel-btn {
		position: static;
		width: 38px;
		height: 38px;
		margin: 0;
		border: 1px solid rgba(255, 255, 255, 0.65);
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.88);
		color: var(--csl-text);
		box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	}

	.csl-auth-shell__carousel-btn::after {
		font-size: 13px;
		font-weight: 700;
	}

	.csl-auth-shell__carousel-btn.swiper-button-disabled {
		opacity: 0.35;
	}

	.csl-auth-shell__form {
		border-left: 1px solid #ececf0;
	}

	.csl-auth-shell__form-inner {
		padding: clamp(40px, 5vw, 72px);
		overflow: hidden;
	}

	body.csl-auth-body--register .csl-auth-shell__form-inner,
	body.csl-auth-body--reset .csl-auth-shell__form-inner {
		overflow-y: auto;
	}

	.csl-auth-form__code-field {
		grid-template-columns: 1fr auto;
	}

	.csl-auth-form__send-code {
		min-width: 118px;
	}
}

@media (min-width: 1280px) {
	:root {
		--csl-split-brand: 34%;
		--csl-split-form: 66%;
	}
}

/* --------------------------------------------------------------------------
   Notice modal (theme-aligned)
   -------------------------------------------------------------------------- */

body.csl-notice-open {
	overflow: hidden;
}

.csl-notice-modal {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.csl-notice-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.csl-notice-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.csl-notice-modal__dialog {
	position: relative;
	width: min(420px, 100%);
	padding: 32px 28px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
	text-align: center;
}

.csl-notice-modal__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 16px;
	color: #dc2626;
}

.csl-notice-modal.is-success .csl-notice-modal__icon {
	color: #15803d;
}

.csl-notice-modal__icon-svg {
	display: none;
}

.csl-notice-modal.is-error .csl-notice-modal__icon-svg--error,
.csl-notice-modal.is-info .csl-notice-modal__icon-svg--error {
	display: block;
}

.csl-notice-modal.is-success .csl-notice-modal__icon-svg--success {
	display: block;
}

.csl-notice-modal__message {
	margin: 0 0 24px;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--csl-text);
}

.csl-notice-modal__actions {
	display: flex;
	justify-content: center;
}

.csl-notice-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 120px;
	min-height: 44px;
	padding: 0 20px;
	border: none;
	border-radius: var(--csl-radius-sm);
	background: var(--csl-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.csl-notice-modal__btn:hover {
	background: var(--csl-accent-hover);
}

