/* Modal Container - Uses z-index.css variables for consistent layering */
.modal-container {
	position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal-tier-1, 600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-overlay {
	position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 50%);
    z-index: var(--z-modal-backdrop, 500);
}

.modal {
	z-index: var(--z-modal-content, 510);
    background: white;
    position: relative;
    width: 885px;
    height: 640px;
    border-radius: 16px;
    box-sizing: border-box;
}

.modal.auth-modal {
	width: 554px;
	height: auto;
}
.modal.w-492 {
	padding: 36px;
    width: 492px;
    height: auto;
}

.modal .strong-text, .auth-ui-wrapper .strong-text {
	font-family: 'Montserrat'; 
	font-size: 28px; 
	font-weight: 600; 
	line-height: 28px;
}
.modal .regular-text, .auth-ui-wrapper .regular-text {
	font-family: 'SFPROTEXT';
    color: #757575;
    font-size: 16px;
    line-height: 20px;
    margin-top: 12px;
}
.text-input, .memory-date-input {
	width: 100%;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 16px 19px;
    box-sizing: border-box;
    font-family: 'SFPROTEXT';
    font-size: 18px;
    color: #757575;
    outline: none;
}
.memory-date-input {
	width: 87px;
}

.text-input.error {
	border-color: #df361f;
}
.text-input.thin {
	padding: 14px 19px;
	font-size: 16px;
}
.text-input.black {
	color: black;
}

.error-msg {
	font-family: 'SFPROTEXT';
    font-size: 14px;
    font-weight: 400;
    color: #df361f;
    margin-top: 5px;
}
.valid-msg {
	font-family: 'SFPROTEXT';
    font-size: 14px;
    font-weight: 400;
    color: #6bba1c;
    margin-top: 5px;
}

.timer-countdown {
	font-family: 'Montserrat';
    font-size: 24px;
    font-weight: 600;
    display: flex; 
    margin: auto;
}
.timer-digit {
	width: 42px;
    height: 48px;
    background: #f3f3f3;
    border-radius: 8px;
    display: flex;
    margin: 0px 2px;
}
.timer-digit span {
	margin: auto;
}
@media screen and (min-width: 812px) {
	.moment-modal{
		width: 100%;
        height: 100% !important;
        top: 0;
        left: 0;
	}
	.memory-marks-container{
		height: min-content !important;
	}
}

@media screen and (max-width: 812px) {
	.modal {
		top: auto;
	    bottom: 0;
	    width: 100%;
	    left: 0;
	    height: auto;
    	max-height: 95%;
	    border-radius: 16px 16px 0 0;
	    overflow: auto;
    	padding-bottom: 82px;
	}
	.modal .strong-text {
		font-size: 24px;
	}

	.modal.auth-modal {
		width: 90%;
		height: min-content;
		border-radius: 16px;
	}
	.modal.w-492 {
		padding: 18px;
	    width: 294px;
	    height: auto;
	    bottom: auto;
	    border-radius: 12px;
	}
	.modal.w-492.fullscreen {
		top: 0;
	    left: 0;
	    width: 100%;
	    height: 100%;
	    max-height: 100%;
	    border-radius: 0;
	}
	.modal.fullscreen {
		height: 100%;
	    max-height: 100%;
	    border-radius: 0;
	    padding: 0;
	}
	.modal.floating:not(.fullscreen) {
		height: auto;
		max-height: none;
		width: 336px;
		position: relative;
	    margin: auto;
	    border-radius: 12px;
	    padding: 16px;
	}

	.timer-countdown {
		font-size: 40px;
    	width: 100%;
	}
	.timer-digit {
		width: 15%;
	}
}

/* ==========================================================================
   First-run welcome (welcome-modal.html) — Trello ONB-15, Figma
   "Onboarding v2": Welcome Sheet v2 (phones, bottom sheet) and Welcome
   Card v2 (desktop >= 813px, centred card). Tokens only
   (seo/css/ds-tokens.css, design-system/AI_RULES.md): 4px grid, radius
   lg 16 / xl 20 / md 12 buttons, one primary action with the dark CTA
   label. The surface follows the OS colour scheme.
   Render-blocking on purpose: first-time visitors see it in the first paint.
   ========================================================================== */
.welcome-modal {
	position: fixed;
	inset: 0;
	z-index: var(--z-modal-tier-1, 600);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overscroll-behavior: contain;
	color: var(--ds-ink);
	font-family: 'SFProText', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}
.welcome-modal[hidden] {
	display: none;
}
.welcome-modal *,
.welcome-modal *::before,
.welcome-modal *::after {
	box-sizing: border-box;
}
.welcome-modal__scrim {
	position: fixed;
	inset: 0;
	background: var(--ds-overlay);
}

/* The sheet: pinned to the bottom; the dialog scrolls when it is taller
   than the screen (the card itself never clips, so its shadow shows). */
.welcome-card {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	margin-top: auto;
	padding: 24px;
	padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	border-radius: var(--radius-xl, 20px) var(--radius-xl, 20px) 0 0;
	background: var(--ds-elevated);
}
.welcome-card:focus {
	outline: none;
}
/* Elevated shadow cast upwards: the token's shadow on a flipped layer. */
.welcome-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 0 0 var(--radius-xl, 20px) var(--radius-xl, 20px);
	box-shadow: var(--ds-shadow-elevated);
	transform: scaleY(-1);
	pointer-events: none;
}
.welcome-card__grabber {
	width: 36px;
	height: 4px;
	margin: 0 auto;
	border-radius: 999px;
	background: var(--ds-line);
}
.welcome-card__header {
	display: none;
}
.welcome-card__body,
.welcome-card__media,
.welcome-card__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.welcome-card__media-note {
	display: none;
}

/* --ds-link is brand-strong in light mode and the lighter orange in dark
   mode, where brand-strong would drop below AA on the elevated surface. */
.welcome-card__overline {
	margin: 0;
	color: var(--ds-link);
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
	letter-spacing: 1px;
	text-transform: uppercase;
}
.welcome-card__title {
	margin: 0;
	color: var(--ds-ink);
	font-family: inherit;
	font-size: 24px;
	font-weight: 700;
	line-height: 32px;
}
.welcome-card__lede {
	margin: 0;
	color: var(--ds-ink-soft);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
}
.welcome-card__values {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.welcome-card__values li {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--ds-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 20px;
}
.welcome-card .welcome-card__icon {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--ds-brand);
	color: var(--ds-on-cta);
	font-size: 16px;
	line-height: 1;
}

.welcome-card__actions {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.welcome-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	border: none;
	border-radius: var(--radius-md, 12px);
	font: inherit;
	cursor: pointer;
	transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.welcome-btn--primary {
	padding: 14px 24px;
	background: var(--ds-brand);
	color: var(--ds-on-cta);
	font-size: 17px;
	font-weight: 700;
	line-height: 24px;
}
.welcome-btn--primary:hover {
	background: var(--ds-brand-hover);
}
.welcome-btn--ghost {
	padding: 12px 20px;
	background: transparent;
	color: var(--ds-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 20px;
}
.welcome-btn--ghost:hover {
	background: var(--ds-surface);
}
.welcome-btn:focus-visible,
.welcome-card__close:focus-visible,
.welcome-video-facade:focus-visible {
	outline: 3px solid var(--ds-focus);
	outline-offset: 2px;
}

.welcome-card__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -12px -12px -12px 0;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: none;
	color: var(--ds-ink-faint);
	cursor: pointer;
}
.welcome-card__close:hover {
	background: var(--ds-surface);
	color: var(--ds-ink);
}

/* Founder video: click-to-load facade (ONB-18). The tile is a media
   surface: `light` in the template pins --ds-ink to the dark value, and
   caption text uses the fixed white --ds-on-brand. */
.welcome-video {
	position: relative;
	height: 192px;
	overflow: hidden;
	border-radius: var(--radius-lg, 16px);
	background: var(--ds-ink);
}
.welcome-video iframe,
.welcome-video-facade {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: inherit;
}
.welcome-video-facade {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: var(--ds-on-brand);
	font: inherit;
	cursor: pointer;
	/* Placeholder glow when no poster frame is available. */
	background:
		radial-gradient(ellipse 70% 90% at 72% 20%, color-mix(in srgb, var(--ds-brand) 70%, transparent), transparent 70%),
		var(--ds-ink);
}
.welcome-video-facade[hidden] {
	display: none;
}
/* Real poster frame behind the play button; the URL is set inline by
   welcome-modal.html (address_transactions/services/welcome_video.py). */
.welcome-video-facade.has-poster {
	background-color: var(--ds-ink);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.welcome-video-facade.has-poster::before,
.welcome-video-facade::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
}
.welcome-video-facade.has-poster::before {
	background: var(--ds-overlay);
}
/* Keeps the caption legible on any frame. */
.welcome-video-facade::after {
	background: linear-gradient(to top, var(--ds-overlay), transparent 55%);
}
.welcome-video-play-icon,
.welcome-video-caption,
.welcome-video-duration {
	z-index: 1;
}
.welcome-video-play-icon {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: 999px;
	background: var(--ds-brand);
	box-shadow: var(--ds-shadow-elevated);
	transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.welcome-video-play-icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -10px 0 0 -6px;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 16px solid var(--ds-on-cta);
}
.welcome-video-facade:hover .welcome-video-play-icon,
.welcome-video-facade:focus-visible .welcome-video-play-icon {
	transform: scale(1.06);
}
.welcome-video-caption,
.welcome-video-duration {
	position: absolute;
	bottom: 16px;
	color: var(--ds-on-brand);
}
.welcome-video-caption {
	left: 16px;
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
}
.welcome-video-duration {
	right: 16px;
	font-size: 13px;
	font-weight: 500;
	line-height: 18px;
}

/* Desktop: Welcome Card v2 — centred card, media beside the copy. */
@media screen and (min-width: 813px) {
	.welcome-modal {
		padding: 32px 16px;
	}
	.welcome-card {
		gap: 20px;
		width: 960px;
		max-width: 100%;
		margin: auto;
		padding: 24px;
		border-radius: var(--radius-xl, 20px);
		box-shadow: var(--ds-shadow-elevated);
	}
	.welcome-card::before,
	.welcome-card__grabber,
	.welcome-card__overline--sheet {
		display: none;
	}
	.welcome-card__header {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.welcome-card__logo {
		flex: 0 0 40px;
		width: 40px;
		height: 40px;
		border-radius: 999px;
	}
	.welcome-card__header .welcome-card__overline {
		flex: 1;
	}
	.welcome-card__body {
		flex-direction: row;
		align-items: center;
		gap: 24px;
	}
	.welcome-card__media {
		flex: 0 0 416px;
		gap: 12px;
	}
	.welcome-video {
		height: 234px;
	}
	.welcome-video-play-icon {
		width: 64px;
		height: 64px;
	}
	.welcome-card__media-note {
		display: block;
		margin: 0;
		color: var(--ds-ink-soft);
		font-size: 13px;
		line-height: 18px;
	}
	.welcome-card__content {
		flex: 1;
		min-width: 0;
		gap: 20px;
	}
	.welcome-card__title {
		font-size: 28px;
		line-height: 36px;
	}
	.welcome-card__lede {
		font-size: 17px;
		line-height: 26px;
	}
	.welcome-card__values li {
		font-size: 16px;
		line-height: 24px;
	}
	.welcome-card__actions {
		flex-direction: row;
		align-items: center;
		gap: 12px;
	}
	.welcome-btn--ghost {
		padding: 14px 24px;
		font-size: 17px;
		line-height: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.welcome-btn,
	.welcome-video-play-icon {
		transition: none;
	}
}
