/*
 * The site's login page, in two looks (login.js picks one and puts its class on
 * <body>; nothing here applies to any other page):
 *
 *   .cwl-skin-default  everyone: neutral Codewinglet sign-in for all apps
 *   .cwl-skin-cafe     /login?redirect-to=/cafe...: the original café app's
 *                      login page (src/app/(auth) in Codewinglet-cafe), as is
 *
 * Frappe's own login page does all the work (sign in, sign up, forgot password,
 * email links, Google); this only restyles it. Light only.
 */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap");

/* --------------------------------------------------- shared: page frame */

body.cwl-skin-default,
body.cwl-skin-cafe {
	margin: 0;
	min-height: 100dvh;
	-webkit-font-smoothing: antialiased;
	color-scheme: light;
}

body.cwl-skin-default .navbar,
body.cwl-skin-default .page-breadcrumbs,
body.cwl-skin-default .page-header-wrapper,
body.cwl-skin-default .page-footer,
body.cwl-skin-cafe .navbar,
body.cwl-skin-cafe .page-breadcrumbs,
body.cwl-skin-cafe .page-header-wrapper,
body.cwl-skin-cafe .page-footer {
	display: none !important;
}

body.cwl-skin-default .page-content-wrapper,
body.cwl-skin-cafe .page-content-wrapper {
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 40px 16px;
}

body.cwl-skin-default main.container,
body.cwl-skin-cafe main.container {
	width: 100%;
	padding: 0;
	margin: 0 auto;
}

/* Frappe's phone rule makes the card a full-height sheet; not here. */
body.cwl-skin-default [class^="for-"] .page-card,
body.cwl-skin-cafe [class^="for-"] .page-card {
	min-height: 0;
	max-width: none;
	margin: 0;
	gap: 0;
}

body.cwl-skin-default .page-card form,
body.cwl-skin-cafe .page-card form {
	gap: 0;
}

body.cwl-skin-default .page-card .form-group,
body.cwl-skin-cafe .page-card .form-group {
	gap: 8px;
	margin-bottom: 18px;
}

body.cwl-skin-default .page-card .page-card-actions,
body.cwl-skin-cafe .page-card .page-card-actions {
	display: grid;
	gap: 10px;
	margin-top: 6px;
}

/* ===================================================== 1. DEFAULT LOOK */

body.cwl-skin-default {
	--cw-ink: #141414;
	--cw-ink-2: #0c0d12;
	--cw-text: #1f2329;
	--cw-muted: #606a78;
	--cw-line: #e3e6ee;
	--cw-bg: #f5f6fa;
	--cw-blue: #2563eb;
	--cw-violet: #a855f7;
	--cw-coral: #ff7f52;
	--cw-pink: #f3405e;
	--cw-panel-w: min(52vw, 760px);

	background:
		radial-gradient(900px 500px at 100% 0%, rgb(37 99 235 / 0.07), transparent 60%),
		radial-gradient(700px 420px at 70% 100%, rgb(168 85 247 / 0.06), transparent 60%),
		var(--cw-bg);
	color: var(--cw-text);
	font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

body.cwl-skin-default main.container {
	max-width: 440px;
}

@media (min-width: 960px) {
	body.cwl-skin-default .page-content-wrapper {
		margin-left: var(--cw-panel-w);
		padding: 48px 40px;
	}
}

/* The card. */
body.cwl-skin-default [class^="for-"] .page-card {
	position: relative;
	padding: 36px 32px 30px;
	border: 1px solid var(--cw-line);
	border-radius: 22px;
	background: #fff;
	box-shadow:
		0 1px 2px rgb(16 24 40 / 0.04),
		0 24px 64px -32px rgb(16 24 40 / 0.28);
	animation: cw-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.cwl-skin-default [class^="for-"] .page-card::before {
	content: "";
	position: absolute;
	inset: 0 32px auto;
	height: 3px;
	border-radius: 0 0 4px 4px;
	background: linear-gradient(90deg, var(--cw-blue), var(--cw-violet), var(--cw-coral));
}

body.cwl-skin-default .page-card-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
	margin-bottom: 26px;
	text-align: left;
}

body.cwl-skin-default .page-card-head .app-logo {
	width: 48px;
	height: 48px;
	max-height: none;
	padding: 11px;
	box-sizing: border-box;
	border-radius: 14px;
	background: var(--cw-ink);
	box-shadow: 0 10px 24px -12px rgb(16 24 40 / 0.6);
}

body.cwl-skin-default .page-card-head h4 {
	margin: 0;
	font-family: inherit;
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--cw-ink);
}

body.cwl-skin-default .page-card-subtitle {
	margin: 6px 0 0;
	font-size: 0.95rem;
	color: var(--cw-muted);
}

body.cwl-skin-default .page-card-subtitle b {
	color: var(--cw-ink);
	font-weight: 600;
}

body.cwl-skin-default .page-card .form-label {
	margin: 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--cw-text);
}

body.cwl-skin-default [class^="for-"] .page-card .page-card-body .form-control {
	height: 48px;
	padding-left: 40px;
	border: 1.5px solid var(--cw-line);
	border-radius: 12px;
	background: #fff;
	color: var(--cw-text);
	font-family: inherit;
	font-size: 0.98rem;
	box-shadow: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

body.cwl-skin-default [class^="for-"] .page-card .form-signup .page-card-body .form-control {
	padding-left: 14px;
}

body.cwl-skin-default [class^="for-"] .page-card .page-card-body .form-control:focus {
	border-color: var(--cw-blue);
	box-shadow: 0 0 0 4px rgb(37 99 235 / 0.14);
	outline: none;
}

body.cwl-skin-default .page-card .field-icon {
	left: 14px;
	color: #8a93a3;
}

body.cwl-skin-default .forgot-password-message {
	align-self: flex-end;
	margin: 0;
}

body.cwl-skin-default .page-card a:not(.btn) {
	color: var(--cw-blue);
	font-weight: 600;
	text-decoration: none;
}

body.cwl-skin-default .page-card a:not(.btn):hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

body.cwl-skin-default .page-card .page-card-actions .btn {
	height: 48px;
	margin: 0;
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.98rem;
	font-weight: 600;
	letter-spacing: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition:
		transform 0.12s,
		box-shadow 0.2s,
		background 0.2s;
}

body.cwl-skin-default .page-card .page-card-actions .btn-login:not(.btn-login-option),
body.cwl-skin-default .page-card .page-card-actions .btn-signup,
body.cwl-skin-default .page-card .page-card-actions .btn-primary {
	border: 0;
	background: var(--cw-ink);
	color: #fff;
	box-shadow: 0 12px 24px -14px rgb(16 24 40 / 0.7);
}

body.cwl-skin-default .page-card .page-card-actions .btn-login:not(.btn-login-option):hover,
body.cwl-skin-default .page-card .page-card-actions .btn-signup:hover,
body.cwl-skin-default .page-card .page-card-actions .btn-primary:hover {
	background: linear-gradient(90deg, var(--cw-blue), var(--cw-violet));
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 16px 30px -14px rgb(37 99 235 / 0.6);
}

body.cwl-skin-default .page-card .page-card-actions .btn-login-option {
	border: 1.5px solid var(--cw-line);
	background: #fff;
	color: var(--cw-text);
}

body.cwl-skin-default .page-card .page-card-actions .btn-login-option:hover {
	border-color: #c9cfdc;
	background: #f8f9fc;
}

body.cwl-skin-default .sign-up-message {
	margin-top: 22px;
	font-size: 0.92rem;
	color: var(--cw-muted);
}

body.cwl-skin-default .cwl-card-foot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 22px 0 0;
	font-size: 0.78rem;
	color: #8a93a3;
}

/* The panel. */
.cwd-panel {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	padding: 28px 24px 34px;
	color: #e9ecf3;
	background: linear-gradient(160deg, #161822 0%, var(--cw-ink-2) 60%, #07080b 100%);
	font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
	isolation: isolate;
}

@media (min-width: 960px) {
	.cwd-panel {
		position: fixed;
		inset: 0 auto 0 0;
		width: var(--cw-panel-w);
		display: flex;
		flex-direction: column;
		padding: 44px 56px;
	}
}

.cwd-orb {
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	filter: blur(70px);
	animation: cw-drift 20s ease-in-out infinite alternate;
}

.cwd-orb.a {
	width: 440px;
	height: 440px;
	top: -140px;
	right: -120px;
	background: var(--cw-blue);
	opacity: 0.45;
}

.cwd-orb.b {
	width: 380px;
	height: 380px;
	bottom: -160px;
	left: -120px;
	background: var(--cw-violet);
	opacity: 0.4;
	animation-duration: 24s;
}

.cwd-orb.c {
	width: 260px;
	height: 260px;
	top: 46%;
	left: 52%;
	background: var(--cw-coral);
	opacity: 0.22;
	animation-duration: 28s;
}

/* Fine grid lines, fading out. */
.cwd-panel::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
	background-size: 44px 44px;
	mask-image: radial-gradient(ellipse at 30% 30%, #000 0%, transparent 75%);
}

.cwd-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cwd-brand img {
	width: 40px;
	height: 40px;
	padding: 9px;
	box-sizing: border-box;
	border-radius: 12px;
	background: rgb(255 255 255 / 0.08);
	border: 1px solid rgb(255 255 255 / 0.14);
}

.cwd-brand strong {
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: #fff;
}

/* "Private Limited" under the name (only that: the greeting pill is a span too). */
.cwd-brand > div > span {
	display: block;
	font-size: 0.72rem;
	color: rgb(233 236 243 / 0.6);
}

.cwd-greeting {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.06);
	border: 1px solid rgb(255 255 255 / 0.12);
	font-size: 0.78rem;
	font-weight: 500;
	white-space: nowrap;
}

.cwd-greeting i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 0 rgb(74 222 128 / 0.6);
	animation: cw-pulse 2.4s infinite;
}

.cwd-main {
	display: grid;
	gap: 18px;
	margin-top: 26px;
}

@media (min-width: 960px) {
	.cwd-main {
		flex: 1;
		align-content: center;
		margin-top: 0;
	}
}

.cwd-kicker {
	width: fit-content;
	padding: 6px 12px;
	border-radius: 999px;
	background: linear-gradient(90deg, rgb(37 99 235 / 0.25), rgb(168 85 247 / 0.25));
	border: 1px solid rgb(255 255 255 / 0.12);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cwd-title {
	margin: 0;
	font-size: clamp(2rem, 4vw, 3.4rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.03em;
	color: #fff;
}

.cwd-title em {
	font-style: normal;
	background: linear-gradient(90deg, #8fb4ff 0%, var(--cw-violet) 45%, var(--cw-coral) 80%, var(--cw-pink) 100%);
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: cw-shine 7s ease-in-out infinite;
}

.cwd-lead {
	margin: 0;
	max-width: 32rem;
	font-size: 1rem;
	line-height: 1.65;
	color: rgb(233 236 243 / 0.72);
}

.cwd-apps {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin: 8px 0 0;
	padding: 0;
	max-width: 36rem;
	list-style: none;
}

.cwd-apps li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	border-radius: 14px;
	background: rgb(255 255 255 / 0.05);
	border: 1px solid rgb(255 255 255 / 0.1);
	backdrop-filter: blur(8px);
	font-size: 0.88rem;
	font-weight: 500;
	opacity: 0;
	animation: cw-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
	transition:
		border-color 0.2s,
		transform 0.2s;
}

.cwd-apps li:hover {
	transform: translateY(-2px);
	border-color: rgb(255 255 255 / 0.25);
}

.cwd-apps img {
	width: 28px;
	height: 28px;
	padding: 3px;
	box-sizing: border-box;
	border-radius: 8px;
	background: #fff;
	object-fit: contain;
}

.cwd-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 16px;
	margin-top: 26px;
	font-size: 0.78rem;
	color: rgb(233 236 243 / 0.5);
}

@media (max-width: 959px) {
	.cwd-lead,
	.cwd-apps,
	.cwd-foot,
	.cwd-greeting {
		display: none;
	}

	.cwd-title {
		font-size: 1.7rem;
	}

	.cwd-main {
		margin-top: 20px;
	}

	body.cwl-skin-default .page-content-wrapper {
		min-height: auto;
		padding: 24px 16px 40px;
	}

	body.cwl-skin-default [class^="for-"] .page-card {
		padding: 28px 22px 24px;
	}
}

/* ==================================================== 2. CAFÉ LOOK
 * The original café app's sign-in page, as it was.
 */

body.cwl-skin-cafe {
	--espresso: #442915;
	--crema: #f2d9b4;
	--background: #f8eedf;
	--foreground: #2e1b0e;
	--primary: #442915;
	--primary-foreground: #f7e6c9;
	--muted-foreground: #7a5f49;
	--input: #dcc5a5;
	--ring: #b87a36;
	--destructive: #b3361a;

	background: var(--background);
	color: var(--foreground);
	font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

body.cwl-skin-cafe main.container {
	max-width: 26rem;
}

@media (min-width: 1024px) {
	body.cwl-skin-cafe .page-content-wrapper {
		margin-left: 50vw;
		padding: 48px 24px;
	}
}

/* No card: the form sits on the cream page, like the original. */
body.cwl-skin-cafe [class^="for-"] .page-card {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

body.cwl-skin-cafe .page-card-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
	margin-bottom: 28px;
	text-align: center;
}

/* The logo above the form on phones; the brand panel has it on desktop. */
body.cwl-skin-cafe .page-card-head .app-logo {
	width: 7rem;
	height: 7rem;
	max-height: none;
	border-radius: 50%;
	box-shadow: 0 18px 50px -18px rgb(68 41 21 / 0.55);
}

@media (min-width: 640px) {
	body.cwl-skin-cafe .page-card-head .app-logo {
		width: 8rem;
		height: 8rem;
	}
}

@media (min-width: 1024px) {
	body.cwl-skin-cafe .page-card-head {
		align-items: flex-start;
		text-align: left;
	}

	body.cwl-skin-cafe .page-card-head .app-logo {
		display: none;
	}
}

body.cwl-skin-cafe .page-card-head h4 {
	margin: 0;
	font-family: "Fraunces", ui-serif, Georgia, serif;
	font-size: 1.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-wrap: balance;
	color: var(--foreground);
}

@media (min-width: 640px) {
	body.cwl-skin-cafe .page-card-head h4 {
		font-size: 2rem;
	}
}

body.cwl-skin-cafe .page-card-subtitle {
	margin: 8px 0 0;
	font-size: 1rem;
	text-wrap: pretty;
	color: var(--muted-foreground);
}

body.cwl-skin-cafe .page-card .form-group {
	margin-bottom: 20px;
}

body.cwl-skin-cafe .page-card .form-label {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--foreground);
}

body.cwl-skin-cafe [class^="for-"] .page-card .page-card-body .form-control {
	height: 44px;
	padding: 4px 14px;
	border: 1px solid var(--input);
	border-radius: 14px;
	background: transparent;
	color: var(--foreground);
	font-family: inherit;
	font-size: 1rem;
	box-shadow: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

body.cwl-skin-cafe [class^="for-"] .page-card .page-card-body .form-control::placeholder {
	color: var(--muted-foreground);
	opacity: 1;
}

body.cwl-skin-cafe [class^="for-"] .page-card .page-card-body .form-control:focus {
	border-color: var(--ring);
	box-shadow: 0 0 0 3px rgb(184 122 54 / 0.5);
	outline: none;
}

/* The original has no icons inside the fields. */
body.cwl-skin-cafe .page-card .field-icon:not(.toggle-password) {
	display: none;
}

body.cwl-skin-cafe .page-card .toggle-password {
	right: 16px;
	color: var(--muted-foreground);
}

/* "Forgot password?" sits beside the Password label, like the original. */
body.cwl-skin-cafe .page-card .form-group:has(.forgot-password-message) {
	position: relative;
}

body.cwl-skin-cafe .forgot-password-message {
	position: absolute;
	top: -2px;
	right: 0;
	margin: 0;
}

body.cwl-skin-cafe .forgot-password-message a {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--muted-foreground);
	text-decoration: none;
}

body.cwl-skin-cafe .page-card a:not(.btn):hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

body.cwl-skin-cafe .page-card .page-card-actions .btn {
	height: 48px;
	margin: 0;
	border-radius: 14px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

body.cwl-skin-cafe .page-card .page-card-actions .btn-login:not(.btn-login-option),
body.cwl-skin-cafe .page-card .page-card-actions .btn-signup,
body.cwl-skin-cafe .page-card .page-card-actions .btn-primary {
	border: 0;
	background: var(--primary);
	color: var(--primary-foreground);
	box-shadow: none;
}

body.cwl-skin-cafe .page-card .page-card-actions .btn-login:not(.btn-login-option):hover,
body.cwl-skin-cafe .page-card .page-card-actions .btn-signup:hover,
body.cwl-skin-cafe .page-card .page-card-actions .btn-primary:hover {
	background: rgb(68 41 21 / 0.8);
	color: var(--primary-foreground);
}

body.cwl-skin-cafe .page-card .page-card-actions .btn-login-option {
	border: 1px solid #e6d2b5;
	background: var(--background);
	color: var(--foreground);
}

body.cwl-skin-cafe .page-card .page-card-actions .btn-login-option:hover {
	background: #f1e3cd;
}

body.cwl-skin-cafe .sign-up-message {
	margin-top: 32px;
	font-size: 1rem;
	color: var(--muted-foreground);
}

body.cwl-skin-cafe .sign-up-message a {
	color: var(--foreground);
	font-weight: 600;
	text-decoration: none;
}

body.cwl-skin-cafe .cwl-card-foot {
	margin: 40px 0 0;
	text-align: center;
	font-size: 0.75rem;
	letter-spacing: 0.025em;
	color: var(--muted-foreground);
}

/* The brand panel (desktop and landscape tablets only). */
.cwc-panel {
	display: none;
}

@media (min-width: 1024px) {
	.cwc-panel {
		position: fixed;
		inset: 0 auto 0 0;
		width: 50vw;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		padding: 48px;
		background: var(--espresso);
		color: var(--crema);
		font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
	}
}

.cwc-dots {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: radial-gradient(circle at 1px 1px, var(--crema) 1px, transparent 0);
	background-size: 22px 22px;
	opacity: 0.08;
}

.cwc-ring {
	position: absolute;
	pointer-events: none;
	border-radius: 50%;
	border: 1px solid rgb(242 217 180 / 0.1);
}

.cwc-ring.a {
	top: -10rem;
	left: -10rem;
	width: 36rem;
	height: 36rem;
}

.cwc-ring.b {
	right: -8rem;
	bottom: -12rem;
	width: 32rem;
	height: 32rem;
}

.cwc-inner {
	position: relative;
	max-width: 28rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.cwc-logo {
	width: 16rem;
	height: 16rem;
	border-radius: 50%;
	box-shadow:
		0 0 0 4px rgb(242 217 180 / 0.15),
		0 18px 50px -18px rgb(68 41 21 / 0.55);
}

@media (min-width: 1280px) {
	.cwc-logo {
		width: 18rem;
		height: 18rem;
	}
}

.cwc-title {
	margin: 40px 0 0;
	font-family: "Fraunces", ui-serif, Georgia, serif;
	font-size: 2.25rem;
	font-weight: 600;
	line-height: 1.2;
	text-wrap: balance;
	color: var(--crema);
}

.cwc-lead {
	margin: 12px 0 0;
	font-size: 1.125rem;
	color: rgb(242 217 180 / 0.75);
}

.cwc-perks {
	display: grid;
	gap: 12px;
	margin: 32px 0 0;
	padding: 0;
	list-style: none;
	text-align: left;
}

.cwc-perks li {
	display: flex;
	align-items: center;
	gap: 12px;
	color: rgb(242 217 180 / 0.9);
}

.cwc-perks span {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgb(242 217 180 / 0.1);
}

/* ------------------------------------------------------------ motion */

@keyframes cw-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes cw-drift {
	to {
		transform: translate(-60px, 50px) scale(1.15);
	}
}

@keyframes cw-shine {
	50% {
		background-position: 100% 0;
	}
}

@keyframes cw-pulse {
	70% {
		box-shadow: 0 0 0 9px rgb(74 222 128 / 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgb(74 222 128 / 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.cwl-skin-default *,
	body.cwl-skin-cafe * {
		animation: none !important;
		transition: none !important;
	}

	.cwd-apps li {
		opacity: 1;
	}
}

/* ------------------------------------------------ fixes for every look */

/* Frappe lays the page out as a flex row, which squeezes our panel on phones. */
body.cwl-skin-default,
body.cwl-skin-cafe {
	display: block;
}

@media (max-width: 959px) {
	.cwd-panel .cwd-greeting {
		display: none;
	}
}

/*
 * Browser autofill (Chrome's blue fill) looks like typed text instead: the same
 * background, text colour and borders as a normal field.
 */
body.cwl-skin-default [class^="for-"] .page-card .page-card-body .form-control:-webkit-autofill,
body.cwl-skin-default [class^="for-"] .page-card .page-card-body .form-control:-webkit-autofill:hover {
	-webkit-text-fill-color: var(--cw-text);
	caret-color: var(--cw-text);
	box-shadow: 0 0 0 1000px #fff inset;
	transition: background-color 600000s 0s;
}

body.cwl-skin-default [class^="for-"] .page-card .page-card-body .form-control:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--cw-text);
	box-shadow:
		0 0 0 1000px #fff inset,
		0 0 0 4px rgb(37 99 235 / 0.14);
}

body.cwl-skin-cafe [class^="for-"] .page-card .page-card-body .form-control:-webkit-autofill,
body.cwl-skin-cafe [class^="for-"] .page-card .page-card-body .form-control:-webkit-autofill:hover {
	-webkit-text-fill-color: var(--foreground);
	caret-color: var(--foreground);
	box-shadow: 0 0 0 1000px var(--background) inset;
	transition: background-color 600000s 0s;
}

body.cwl-skin-cafe [class^="for-"] .page-card .page-card-body .form-control:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--foreground);
	box-shadow:
		0 0 0 1000px var(--background) inset,
		0 0 0 3px rgb(184 122 54 / 0.5);
}


/* After signing in from the café's login page, the redirect splash is the café's. */
body.cwl-skin-cafe .splash {
	background: #f8eedf;
}

body.cwl-skin-cafe .splash::before {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: url("/assets/codewinglet_cafe/images/logo-512.png") center / cover no-repeat;
	box-shadow:
		0 0 0 4px rgb(242 217 180 / 0.6),
		0 18px 50px -18px rgb(68 41 21 / 0.55);
}

body.cwl-skin-cafe .splash::after {
	background:
		linear-gradient(90deg, transparent, #442915, #c98b3c, transparent) 0 0 / 50% 100% no-repeat,
		rgb(68 41 21 / 0.1);
}

/* ---------------------------------------- Frappe's pop-up messages on these pages */

/* Desktop: over the form column, not the side panel. Phones: inside the screen. */
body.cwl-skin-default .modal-dialog,
body.cwl-skin-cafe .modal-dialog {
	width: auto;
	max-width: 440px;
	margin: 12vh auto 24px;
}

@media (min-width: 960px) {
	body.cwl-skin-default .modal-dialog {
		margin-left: calc(var(--cw-panel-w) + (100vw - var(--cw-panel-w) - 440px) / 2);
	}
}

@media (min-width: 1024px) {
	body.cwl-skin-cafe .modal-dialog {
		margin-left: calc(50vw + (50vw - 440px) / 2);
	}
}

@media (max-width: 959px) {
	body.cwl-skin-default .modal-dialog,
	body.cwl-skin-cafe .modal-dialog {
		max-width: calc(100vw - 32px);
		margin: 16px auto;
	}
}

body.cwl-skin-default .modal-content,
body.cwl-skin-cafe .modal-content {
	border: 1px solid rgb(16 24 40 / 0.08);
	border-radius: 20px;
	box-shadow: 0 30px 70px -30px rgb(16 24 40 / 0.45);
	overflow: hidden;
	font-family: inherit;
}

body.cwl-skin-default .modal-header,
body.cwl-skin-cafe .modal-header {
	padding: 18px 20px 6px;
	border: 0;
}

body.cwl-skin-default .modal-title,
body.cwl-skin-cafe .modal-title {
	font-size: 1.05rem;
	font-weight: 600;
}

body.cwl-skin-default .modal-body,
body.cwl-skin-cafe .modal-body {
	padding: 6px 20px 20px;
	font-size: 0.95rem;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

body.cwl-skin-cafe .modal-content {
	background: #fffaf2;
	color: #2e1b0e;
}

/* Frappe writes status messages into the button ("Only @… can be used…"): wrap, don't spill. */
body.cwl-skin-default [class^="for-"] .page-card .page-card-actions .btn,
body.cwl-skin-cafe [class^="for-"] .page-card .page-card-actions .btn {
	height: auto;
	min-height: 48px;
	padding: 10px 16px;
	white-space: normal;
	line-height: 1.3;
	text-align: center;
}

/* No gap on the right while a pop-up is open (space Frappe keeps for a scrollbar). */
body.cwl-skin-default.modal-open,
body.cwl-skin-cafe.modal-open {
	padding-right: 0 !important;
}

/* ------------------------------------------------ panel fixes */

/* The "Good morning" pill: the dot sits in line, before the text (not in the corner). */
.cwd-greeting i {
	display: inline-block;
	flex-shrink: 0;
	position: static;
	margin: 0;
	font-style: normal;
}

/* The pill keeps to the right edge of the panel's top row. */
.cwd-brand > div {
	min-width: 0;
}

.cwd-greeting {
	display: inline-flex;
	margin-left: auto;
	flex-shrink: 0;
}

/* App tiles never run past the panel: as many per row as fit. */
.cwd-apps {
	max-width: 100%;
	grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
}

.cwd-apps li {
	min-width: 0;
}

.cwd-apps li span {
	min-width: 0;
	overflow-wrap: anywhere;
}
