:root {
	--bg: #f4f7fb;
	--bg-accent: #dff3ec;
	--surface: rgba(255, 255, 255, 0.88);
	--surface-strong: #ffffff;
	--text: #14213d;
	--muted: #5f6b85;
	--primary: #0f766e;
	--primary-dark: #0b5d58;
	--secondary: #f59e0b;
	--border: rgba(20, 33, 61, 0.1);
	--shadow: 0 20px 45px rgba(20, 33, 61, 0.12);
	--radius-xl: 24px;
	--radius-lg: 18px;
	--radius-md: 12px;
}
 
* {
	box-sizing: border-box;
}

html {
	font-size: 16px;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: "Segoe UI", Arial, sans-serif;
	line-height: 1.6;
	color: var(--text);
	background:
		radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 32%),
		radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 26%),
		linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

body.prof-page {
	background:
		radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34%),
		radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 26%),
		linear-gradient(180deg, #eef5ff 0%, #dcecff 100%);
}

a {
	color: inherit;
}

.card-link {
	display: block;
	text-decoration: none;
}

.page-shell {
	width: min(1100px, calc(100% - 32px));
	margin: 0 auto;
	padding: 24px 0 40px;
}

.topbar {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 14px;
}

.topbar-split {
	justify-content: space-between;
	align-items: center;
}

.topbar-actions {
	display: flex;
	gap: 10px;
	margin-left: auto;
}

.panel {
	background: var(--surface);
	backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow);
}

.button,
button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	box-shadow: 0 12px 25px rgba(15, 118, 110, 0.25);
}

.button:hover,
button:hover {
	transform: translateY(-1px);
}

.button-small {
	padding: 8px 12px;
	font-size: 0.88rem;
	font-weight: 600;
}

.button-icon {
	min-width: 42px;
	padding-left: 0;
	padding-right: 0;
	font-size: 1.1rem;
}

.button-secondary {
	background: rgba(255, 255, 255, 0.76);
	color: var(--text);
	box-shadow: none;
	border: 1px solid var(--border);
}

.button-danger {
	background: linear-gradient(135deg, #dc2626, #b91c1c);
	box-shadow: 0 12px 25px rgba(185, 28, 28, 0.24);
}

.toggle-form {
	margin-top: 18px;
}

.exercise-settings-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 18px;
}

.switch-row {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
}

.switch-button {
	position: relative;
	width: 58px;
	height: 32px;
	padding: 0;
	border-radius: 999px;
	box-shadow: none;
}

.switch-on {
	background: linear-gradient(135deg, #16a34a, #22c55e);
}

.switch-off {
	background: linear-gradient(135deg, #94a3b8, #64748b);
}

.switch-knob {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 24px;
	height: 24px;
	border-radius: 999px;
	background: #fff;
	transition: transform 0.18s ease;
}

.switch-on .switch-knob {
	transform: translateX(26px);
}

.hero {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 24px;
	align-items: stretch;
}

.hero-card,
.login-card,
.exercise-card,
.empty-card,
.info-card {
	border-radius: var(--radius-xl);
}

.hero-card {
	padding: 28px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(223, 243, 236, 0.92));
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.hero-card-prof {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(219, 234, 254, 0.94));
}

.hero-card h1,
.login-card h1 {
	margin: 0 0 10px;
	font-size: clamp(1.9rem, 3vw, 2.8rem);
	line-height: 1.1;
}

.hero-card p,
.login-card p,
.intro-text,
.meta,
.muted {
	color: var(--muted);
}

.stat-card {
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
 
.stat-value {
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 700;
	line-height: 1;
	margin: 8px 0 4px;
	color: var(--primary);
}

.stat-card-prof {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(219, 234, 254, 0.9));
}

.stat-value-prof {
	color: #1d4ed8;
}
    
.tag {
	display: inline-flex;
	align-items: center;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(15, 118, 110, 0.12);
	color: var(--primary-dark);
	font-size: 0.92rem;
	font-weight: 600;
}

.tag-prof {
	background: rgba(37, 99, 235, 0.12);
	color: #1d4ed8;
}

.tag-success {
	background: rgba(22, 163, 74, 0.14);
	color: #15803d;
}

.dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}

.dashboard-header-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.exercise-card {
	padding: 22px;
	background: var(--surface-strong);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.exercise-card h3 {
	margin: 0 0 10px;
	font-size: 1.2rem;
}

.exercise-card p {
	margin: 0 0 14px;
}

.section-title {
	margin: 30px 0 16px;
	font-size: 1.35rem;
}

.login-page {
	display: grid;
	place-items: center;
	padding: 24px 0;
	min-height: 100vh;
}

.login-layout {
	width: min(100%, 980px);
	display: grid;
	grid-template-columns: 1fr 420px;
	gap: 24px;
	align-items: center;
}

.login-side {
	padding: 32px;
}

.login-card {
	padding: 28px;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.form-group {
	margin-bottom: 16px;
}

label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
}

input {
	width: 100%;
	padding: 13px 14px;
	border: 1px solid rgba(20, 33, 61, 0.16);
	border-radius: var(--radius-md);
	background: #fff;
	font: inherit;
	color: var(--text);
}

select {
	width: 100%;
	padding: 13px 14px;
	border: 1px solid rgba(20, 33, 61, 0.16);
	border-radius: var(--radius-md);
	background: #fff;
	font: inherit;
	color: var(--text);
}

textarea {
	width: 100%;
	padding: 13px 14px;
	border: 1px solid rgba(20, 33, 61, 0.16);
	border-radius: var(--radius-md);
	background: #fff;
	font: inherit;
	color: var(--text);
	resize: vertical;
	min-height: 120px;
}

input:focus {
	outline: 2px solid rgba(15, 118, 110, 0.18);
	border-color: var(--primary);
}

select:focus {
	outline: 2px solid rgba(15, 118, 110, 0.18);
	border-color: var(--primary);
}

textarea:focus {
	outline: 2px solid rgba(15, 118, 110, 0.18);
	border-color: var(--primary);
}

.error {
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: var(--radius-md);
	background: rgba(176, 0, 32, 0.08);
	color: #9f1239;
	border: 1px solid rgba(176, 0, 32, 0.12);
}

.empty-card,
.info-card {
	padding: 24px;
	border: 1px dashed rgba(20, 33, 61, 0.16);
	background: rgba(255, 255, 255, 0.7);
}

.accent-line {
	width: 72px;
	height: 8px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--primary), var(--secondary));
	margin-bottom: 18px;
}

.accent-line-prof {
	background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.chat-page {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

.chat-header {
	padding: 26px;
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.chat-header h1 {
	margin: 0 0 12px;
	font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.chat-header-side {
	min-width: 180px;
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
}

.audio-settings {
	display: grid;
	gap: 10px;
}

.speed-control {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	color: var(--text);
}

.speed-control select {
	padding: 8px 10px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--text);
	font: inherit;
}

.chat-thread {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-height: 240px;
}

.chat-empty {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.message-row {
	display: flex;
}

.message-row-bot {
	justify-content: flex-start;
}

.message-row-user {
	justify-content: flex-end;
}

.message-bubble {
	max-width: min(760px, 88%);
	padding: 14px 16px;
	border-radius: 18px;
	box-shadow: 0 10px 24px rgba(20, 33, 61, 0.08);
}

.message-bubble-bot {
	background: #ffffff;
	border: 1px solid var(--border);
	border-top-left-radius: 6px;
}

.message-bubble-user {
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	color: #ffffff;
	border-top-right-radius: 6px;
}

.message-bubble-user .message-author,
.message-bubble-user .message-date {
	color: rgba(255, 255, 255, 0.8);
}

.message-author {
	font-size: 0.85rem;
	font-weight: 700;
	margin-bottom: 6px;
	color: var(--muted);
}

.message-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
}

.message-head .message-author {
	margin-bottom: 0;
}

.message-audio-button {
	min-width: 34px;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 999px;
	background: rgba(37, 99, 235, 0.12);
	color: #1d4ed8;
	box-shadow: none;
}

.message-audio-button[data-audio-state="playing"] {
	background: rgba(220, 38, 38, 0.14);
	color: #b91c1c;
}

.message-audio-icon {
	font-size: 0.95rem;
	line-height: 1;
}

.message-date {
	margin-top: 8px;
	font-size: 0.78rem;
	color: var(--muted);
}

.message-note {
	margin-top: 10px;
	font-size: 0.84rem;
	font-weight: 700;
}

.message-note-ok {
	color: #15803d;
}

.message-note-warning {
	color: #c2410c;
}

.message-note-pending {
	color: rgba(255, 255, 255, 0.86);
}

.message-bubble-user .message-note-ok {
	color: #bbf7d0;
}

.message-bubble-user .message-note-warning {
	color: #fdba74;
}

.typing-indicator {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 18px;
}

.typing-indicator span {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: rgba(20, 33, 61, 0.38);
	animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
	animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes typing-bounce {
	0%,
	80%,
	100% {
		transform: translateY(0);
		opacity: 0.45;
	}

	40% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

.chat-form {
	padding: 20px;
	display: grid;
	gap: 14px;
}

.message-compose {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: stretch;
}

.message-compose textarea {
	min-height: 84px;
}

.audio-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.audio-status {
	font-size: 0.9rem;
	color: var(--muted);
}

.voice-button {
	width: 56px;
	min-width: 56px;
	padding: 0;
	border-radius: 18px;
	background: rgba(37, 99, 235, 0.1);
	color: #1d4ed8;
	box-shadow: none;
	border: 1px solid rgba(37, 99, 235, 0.14);
}

.voice-button:hover {
	transform: none;
}

.voice-button-active {
	background: linear-gradient(135deg, #ef4444, #dc2626);
	color: #ffffff;
	border-color: rgba(220, 38, 38, 0.35);
}

.voice-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
}

.voice-icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.success {
	margin-top: 16px;
	padding: 16px 18px;
	border-radius: var(--radius-md);
	background: rgba(21, 128, 61, 0.1);
	color: #166534;
	border: 1px solid rgba(21, 128, 61, 0.15);
}

.credentials-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 14px;
}

.credential-card {
	display: grid;
	gap: 4px;
	padding: 14px;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid rgba(21, 128, 61, 0.12);
}

.group-card {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.96));
}

.card-link .group-card {
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-link:hover .group-card {
	transform: translateY(-2px);
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.5);
	z-index: 50;
}

.modal-backdrop[hidden] {
	display: none !important;
}

.modal-card {
	width: min(760px, 100%);
	padding: 22px;
	background: rgba(255, 255, 255, 0.98);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

.modal-header h2 {
	margin: 0;
}

.modal-close {
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--text);
	box-shadow: none;
}

.modal-close-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: #fff;
	text-decoration: none;
	color: var(--text);
}

.modal-form {
	display: grid;
	gap: 14px;
}

.student-list {
	display: grid;
	gap: 12px;
	max-height: 280px;
	overflow-y: auto;
	margin-bottom: 8px;
}

.student-row {
	display: grid;
	gap: 4px;
	padding: 14px;
	border-radius: var(--radius-md);
	background: rgba(239, 246, 255, 0.75);
	border: 1px solid rgba(37, 99, 235, 0.12);
}

.teacher-thread {
	margin-top: 12px;
	min-height: auto;
	max-height: 60vh;
}

.divider {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 18px 0;
}

@media (max-width: 900px) {
	.hero,
	.login-layout,
	.grid,
	.credentials-list {
		grid-template-columns: 1fr;
	}

	.dashboard-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.topbar {
		margin-bottom: 18px;
	}

	.chat-header {
		flex-direction: column;
	}

	.chat-header-side {
		justify-content: flex-start;
	}
}

@media (max-width: 640px) {
	.page-shell {
		width: min(100% - 20px, 1100px);
		padding: 16px 0 28px;
	}

	.hero-card,
	.login-side,
	.login-card,
	.exercise-card,
	.empty-card,
	.info-card,
	.stat-card {
		padding: 18px;
	}

	.hero-card h1,
	.login-card h1 {
		font-size: 1.8rem;
	}

	.button,
	button {
		width: 100%;
	}

	.topbar {
		flex-direction: column;
		align-items: stretch;
	}

	.dashboard-header-actions {
		width: 100%;
	}

	.dashboard-header-actions .button {
		flex: 1 1 auto;
	}

	.message-bubble {
		max-width: 100%;
	}

	.message-compose {
		grid-template-columns: 1fr;
	}

	.voice-button {
		width: 100%;
		min-width: 0;
		min-height: 48px;
	}

	.modal-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
