/* =========================================================================
   Zosma Cowork — Mobile UI
   Glossy, modern look with glassmorphism and gradient backgrounds
   ========================================================================= */

@import "tailwindcss";

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

:root {
	--bg-primary: #0a0a12;
	--bg-secondary: #12121f;
	--bg-glass: rgba(255, 255, 255, 0.04);
	--bg-glass-hover: rgba(255, 255, 255, 0.08);
	--border-glass: rgba(255, 255, 255, 0.08);
	--border-glass-strong: rgba(255, 255, 255, 0.15);
	--text-primary: #f0f0f5;
	--text-secondary: rgba(255, 255, 255, 0.6);
	--text-muted: rgba(255, 255, 255, 0.35);
	--accent: #8b5cf6;
	--accent-soft: rgba(139, 92, 246, 0.15);
	--accent-glow: rgba(139, 92, 246, 0.3);
	--emerald: #10b981;
	--emerald-soft: rgba(16, 185, 129, 0.15);
	--amber: #f59e0b;
	--red: #ef4444;
	--red-soft: rgba(239, 68, 68, 0.15);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-top: env(safe-area-inset-top, 0px);
}

html,
body {
	height: 100%;
	overflow: hidden;
	background: var(--bg-primary);
	color: var(--text-primary);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

#root {
	height: 100%;
}

/* ---- Mobile App wrapper ---- */
.mobile-app {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--bg-primary);
	position: relative;
	overflow: hidden;
}

/* =========================================================================
   OTP Page — Glossy Landing
   ========================================================================= */

.otp-page {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	padding: 24px 20px;
	padding-top: calc(24px + var(--safe-top));
	padding-bottom: calc(24px + var(--safe-bottom));
}

/* ---- Animated background orbs ---- */
.otp-bg-orbs {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.4;
	animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
	width: 300px;
	height: 300px;
	background: var(--accent);
	top: -10%;
	left: -20%;
	animation-delay: 0s;
}

.orb-2 {
	width: 250px;
	height: 250px;
	background: #06b6d4;
	bottom: -10%;
	right: -20%;
	animation-delay: -3s;
}

.orb-3 {
	width: 200px;
	height: 200px;
	background: var(--emerald);
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	animation-delay: -6s;
	opacity: 0.2;
}

@keyframes orbFloat {
	0%,
	100% {
		transform: translate(0, 0) scale(1);
	}
	25% {
		transform: translate(30px, -30px) scale(1.05);
	}
	50% {
		transform: translate(-20px, 20px) scale(0.95);
	}
	75% {
		transform: translate(20px, 30px) scale(1.02);
	}
}

/* ---- Content ---- */
.otp-content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 360px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
}

/* ---- Brand ---- */
.otp-brand {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.otp-logo {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--accent), #7c3aed);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 32px var(--accent-glow);
	margin-bottom: 4px;
}

.otp-logo-icon {
	width: 28px;
	height: 28px;
	color: white;
}

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

.otp-subtitle {
	font-size: 14px;
	color: var(--text-secondary);
	font-weight: 400;
}

/* ---- Glossy Card ---- */
.otp-card {
	width: 100%;
	background: var(--bg-glass);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid var(--border-glass);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 8px 48px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.otp-card-inner {
	padding: 32px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	text-align: center;
}

/* ---- Icon circle ---- */
.otp-icon-circle {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--accent-soft);
	border: 1px solid var(--border-glass-strong);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 4px;
	position: relative;
}

.otp-icon-circle.validating {
	background: var(--emerald-soft);
	border-color: rgba(16, 185, 129, 0.3);
}

.otp-icon-circle.error,
.otp-icon-circle.expired {
	background: var(--red-soft);
	border-color: rgba(239, 68, 68, 0.3);
}

.otp-icon {
	width: 28px;
	height: 28px;
	color: var(--accent);
}

.otp-error-icon {
	font-size: 24px;
	font-weight: 700;
	color: var(--red);
}

/* ---- Spinner ---- */
.otp-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid var(--emerald-soft);
	border-top-color: var(--emerald);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---- Card text ---- */
.otp-card-title {
	font-size: 20px;
	font-weight: 600;
	color: var(--text-primary);
}

.otp-card-text {
	font-size: 14px;
	color: var(--text-secondary);
	line-height: 1.5;
	max-width: 300px;
}

.otp-card-info {
	color: var(--accent);
	background: var(--accent-soft);
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 13px;
	max-width: 100%;
}

.otp-card-error {
	color: var(--red);
	background: var(--red-soft);
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 13px;
	max-width: 100%;
}

/* ---- Divider ---- */
.otp-divider {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 12px;
}

.otp-divider-line {
	flex: 1;
	height: 1px;
	background: var(--border-glass);
}

.otp-divider-text {
	font-size: 11px;
	color: var(--text-muted);
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ---- Form ---- */
.otp-form {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.otp-input-group {
	width: 100%;
}

.otp-input {
	width: 100%;
	height: 52px;
	font-size: 28px;
	font-weight: 700;
	font-family: "SF Mono", "Fira Code", "Courier New", monospace;
	letter-spacing: 8px;
	text-align: center;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--border-glass-strong);
	border-radius: 14px;
	color: var(--text-primary);
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.otp-input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.otp-input::placeholder {
	letter-spacing: 4px;
	font-weight: 400;
	color: var(--text-muted);
}

/* ---- Buttons ---- */
.otp-btn {
	width: 100%;
	height: 50px;
	border: none;
	border-radius: 14px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;

	background: linear-gradient(135deg, var(--accent), #7c3aed);
	color: white;
	box-shadow: 0 4px 20px var(--accent-glow);
}

.otp-btn:active {
	transform: scale(0.97);
	opacity: 0.9;
}

.otp-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.otp-btn-secondary {
	background: var(--bg-glass-hover);
	border: 1px solid var(--border-glass-strong);
	color: var(--text-primary);
	box-shadow: none;
}

.otp-btn-secondary:active {
	background: var(--bg-glass-hover);
}

/* ---- Hint ---- */
.otp-hint {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: var(--bg-glass);
	border-radius: 10px;
	font-size: 12px;
	color: var(--text-muted);
}

.otp-hint-icon {
	width: 14px;
	height: 14px;
	color: var(--text-muted);
}

/* ---- Footer ---- */
.otp-footer {
	text-align: center;
}

.otp-footer-text {
	font-size: 12px;
	color: var(--text-muted);
	max-width: 280px;
	line-height: 1.4;
}

/* =========================================================================
   Chat Page
   ========================================================================= */

.chat-page {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--bg-primary);
}

/* ---- Status bar ---- */
.chat-status-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	padding-top: calc(8px + var(--safe-top));
	background: var(--bg-secondary);
	border-bottom: 1px solid var(--border-glass);
	z-index: 10;
	flex-shrink: 0;
}

.chat-status-bar.connected {
	background: linear-gradient(to bottom, var(--bg-secondary), transparent);
}

.chat-status-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.chat-back-btn {
	width: 36px;
	height: 36px;
	border: none;
	background: var(--bg-glass);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s;
	-webkit-tap-highlight-color: transparent;
}

.chat-back-btn:active {
	background: var(--bg-glass-hover);
}

.chat-back-icon {
	width: 20px;
	height: 20px;
	color: var(--text-primary);
}

.chat-status-indicator {
	display: flex;
	align-items: center;
	gap: 6px;
}

.chat-status-icon {
	width: 14px;
	height: 14px;
}

.chat-status-icon.connected {
	color: var(--emerald);
}

.chat-status-icon.disconnected {
	color: var(--amber);
}

.chat-status-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--text-secondary);
}

/* ---- Chat content area ---- */
.chat-page-content {
	flex: 1;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
