:root {
  --bg: #f3f8f4;
  --surface: #ffffff;
  --surface-soft: #eaf4ed;
  --primary: #2f8f63;
  --primary-dark: #1f6f4b;
  --primary-soft: #d9efe2;
  --text: #17342a;
  --muted: #66776f;
  --line: #dce9e2;
  --warning: #b7791f;
  --error: #b42318;
  --shadow: 0 20px 50px rgba(28, 88, 63, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

main {
  min-height: 70vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--primary-dark);
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--primary-dark);
}

.nav-form {
  margin: 0;
}

.nav-toggle {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(47, 143, 99, 0.22);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline,
.btn-soft {
  background: #ffffff;
  border-color: var(--line);
  color: var(--primary-dark);
}

.btn-light {
  background: #ffffff;
  color: var(--primary-dark);
}

.btn.full {
  width: 100%;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.hero,
.page-hero,
.section,
.calm-band,
.auth-wrap {
  padding: clamp(48px, 7vw, 92px) clamp(20px, 5vw, 72px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero-copy h1,
.page-hero h1,
.dashboard h1 {
  margin: 12px 0 18px;
  max-width: 780px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy p,
.page-hero p,
.section-heading p {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-media {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-soft) 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-media img,
.rounded-img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  background: var(--primary-soft);
  border: 1px solid #c7e6d4;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 32px;
  text-align: center;
}

.section-heading.left {
  margin-right: 0;
  margin-left: 0;
  text-align: left;
}

.section h2,
.calm-band h2,
.auth-card h1 {
  margin: 12px 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.16;
}

.feature-grid,
.profile-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.profile-card,
.stat-card,
.panel,
.table-card,
.auth-card,
.demo-box,
.chat-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card,
.profile-card,
.stat-card,
.panel,
.auth-card,
.demo-box {
  padding: 24px;
}

.card h3,
.profile-card h3 {
  margin: 0 0 10px;
}

.card p,
.profile-card p,
.auth-card p,
.demo-box p {
  color: var(--muted);
  line-height: 1.7;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  background: var(--primary-soft);
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 700;
}

.calm-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--primary-dark);
  color: #ffffff;
}

.calm-band h2 {
  max-width: 780px;
}

.calm-band .eyebrow {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(28px, 5vw, 56px);
}

.check-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.check-list p {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: var(--text);
}

.page-hero.compact {
  padding-bottom: 32px;
}

.profile-card {
  display: flex;
  gap: 18px;
}

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

.counselor-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #cfe3d8;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.counselor-card-visual {
  position: relative;
  min-height: 320px;
  padding: 10px 24px 58px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0, rgba(255, 255, 255, 0.10) 10px, transparent 10px, transparent 24px),
    linear-gradient(135deg, #1f8f63 0%, #2fbf85 100%);
}

.counselor-portrait {
  position: absolute;
  right: 12px;
  bottom: 28px;
  left: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 292px;
  overflow: visible;
}

.avatar.poster {
  width: min(86%, 300px);
  height: 292px;
  background: transparent;
  border: 0;
  border-radius: 8px 8px 0 0;
  color: var(--primary-dark);
  font-size: 72px;
  box-shadow: none;
}

.avatar.poster img {
  width: 100%;
  height: 100%;
  border-radius: 8px 8px 0 0;
  object-fit: contain;
  object-position: bottom center;
}

.counselor-name-pill {
  position: absolute;
  right: 24px;
  bottom: -32px;
  left: 24px;
  min-height: 76px;
  padding: 14px 18px;
  background: #58dfe1;
  border-radius: 8px;
  color: #0b5f48;
  text-align: center;
  box-shadow: 0 14px 28px rgba(10, 74, 48, 0.16);
}

.counselor-name-pill h3 {
  margin: 0;
  color: #14342b;
  font-size: 18px;
  line-height: 1.2;
  text-transform: uppercase;
}

.counselor-name-pill span {
  display: block;
  margin-top: 4px;
  color: #11634a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.counselor-card-body {
  display: grid;
  gap: 16px;
  padding: 52px 22px 22px;
  text-align: center;
}

.counselor-card-body p {
  min-height: 78px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.counselor-actions {
  justify-content: center;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary-dark);
  font-weight: 700;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-upload-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.avatar-preview-wrap .avatar {
  width: 96px;
  height: 96px;
  font-size: 32px;
}

.avatar-upload-fields {
  flex: 1;
  min-width: 220px;
}

.file-label input[type="file"] {
  margin-top: 8px;
  font: inherit;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.checkbox-label input {
  width: auto;
}

.auth-wrap {
  display: grid;
  grid-template-columns: minmax(300px, 520px);
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 210px);
  gap: 22px;
}

.auth-card {
  width: 100%;
}

.form {
  display: grid;
  gap: 16px;
}

.form label,
.mini-form label,
.field-group {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.field-label {
  display: block;
  min-height: 21px;
  line-height: 1.5;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row > .field-group > .field-label {
  height: 21px;
  overflow: visible;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(47, 143, 99, 0.16);
  border-color: var(--primary);
}

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

.flash {
  margin: 18px clamp(20px, 5vw, 72px) 0;
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}

.flash-error {
  background: #fde8e6;
  color: var(--error);
}

.dashboard {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 32px clamp(20px, 5vw, 72px) 72px;
}

.sidebar {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar h2 {
  margin: 8px 0 0;
}

.sidebar p {
  margin: 0 0 12px;
  color: var(--muted);
}

.sidebar a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
}

.sidebar a:hover,
.sidebar a.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.sidebar a.is-active {
  font-weight: 600;
}

.schedule-note,
.field-hint {
  color: var(--muted);
  line-height: 1.6;
}

.field-hint-error {
  color: var(--error);
  font-weight: 600;
}

.field-hint.compact {
  margin: 0;
  font-size: 13px;
}

.calendar-picker {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #f7fbf8;
  border: 1px solid #cfe3d8;
  border-radius: 8px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font: inherit;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.calendar-nav:first-child {
  justify-self: start;
}

.calendar-nav:last-child {
  justify-self: end;
}

.calendar-nav:hover {
  transform: translateY(-1px);
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.calendar-title {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.calendar-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.calendar-title strong {
  color: var(--primary-dark);
  font-size: 18px;
  line-height: 1.2;
}

.calendar-date-label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.calendar-date-label select {
  background: #ffffff;
}

.time-picker {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 182px;
  padding: 14px;
  background: #f7fbf8;
  border: 1px solid #cfe3d8;
  border-radius: 8px;
}

.time-picker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 800;
}

.time-picker-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.time-picker-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.time-picker input[type="time"] {
  background: #ffffff;
  font-weight: 700;
}

.chat-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-detail {
  padding: 28px;
}

.profile-detail-head {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.profile-specialty {
  margin: 8px 0 0;
  color: var(--primary-dark);
  font-weight: 600;
}

.profile-detail-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.profile-detail-body p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.profile-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard.single-column {
  grid-template-columns: 1fr;
}

.profile-card .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inline-delete {
  display: inline;
  margin: 0;
}

.dashboard-content {
  min-width: 0;
}

.stat-grid {
  margin-bottom: 20px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.table-card {
  overflow-x: auto;
}

.admin-create-form {
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7fbf8;
  color: var(--primary-dark);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  background: var(--primary-soft);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.table-note {
  display: block;
  max-width: 260px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.inline-actions {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.inline-actions textarea {
  min-height: 64px;
  font-size: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-shell {
  overflow: hidden;
  border-color: #cfe3d8;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
  border-bottom: 1px solid #d7e8df;
}

.chat-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.chat-header-avatars {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.chat-header-avatars.stacked .avatar + .avatar {
  margin-left: -16px;
}

.avatar.chat-header-avatar {
  width: 64px;
  height: 64px;
  border: 3px solid #ffffff;
  font-size: 22px;
  box-shadow: 0 12px 26px rgba(28, 88, 63, 0.16);
}

.chat-header h1 {
  margin: 8px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.chat-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  height: 480px;
  overflow-y: auto;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)),
    repeating-linear-gradient(135deg, #edf6f0 0, #edf6f0 1px, transparent 1px, transparent 22px);
}

.bubble {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  width: min(82%, 680px);
  justify-self: start;
}

.bubble.own {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) 42px;
  color: #ffffff;
}

.bubble.own .bubble-avatar {
  grid-column: 2;
  grid-row: 1;
}

.bubble.own .bubble-content {
  grid-column: 1;
  grid-row: 1;
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.bubble-avatar .avatar {
  width: 42px;
  height: 42px;
  box-shadow: 0 8px 18px rgba(28, 88, 63, 0.12);
}

.bubble-content {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #d7e8df;
  border-radius: 8px 8px 8px 2px;
  box-shadow: 0 12px 28px rgba(28, 88, 63, 0.08);
}

.bubble.own .bubble-content {
  border-radius: 8px 8px 2px 8px;
}

.bubble-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.bubble-meta strong {
  font-size: 14px;
}

.bubble-meta span,
.bubble small {
  opacity: 0.72;
  font-size: 12px;
}

.bubble p {
  margin: 0 0 8px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
  border-top: 1px solid #d7e8df;
}

.chat-form textarea {
  min-height: 58px;
  max-height: 150px;
  background: #f7fbf8;
  border-color: #cfe3d8;
}

.chat-form .btn {
  min-height: 52px;
  padding-right: 22px;
  padding-left: 22px;
}

.empty-state {
  align-self: center;
  justify-self: center;
  color: var(--muted);
}

.locked-chat {
  display: grid;
  justify-items: center;
  max-width: 560px;
  text-align: center;
}

.locked-chat h3 {
  margin: 0;
  color: var(--text);
}

.locked-chat p,
.locked-form p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.locked-form {
  display: block;
  background: #f7fbf8;
}

.mini-form {
  margin-top: 12px;
}

.footer {
  padding: 48px clamp(20px, 5vw, 72px);
  background: #17342a;
  color: #d8ebe1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}

.footer h3 {
  margin: 0 0 12px;
  color: #ffffff;
}

.footer p,
.footer a {
  display: block;
  margin: 0 0 8px;
  color: #d8ebe1;
  line-height: 1.7;
}

.copyright {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 14px;
    color: var(--primary-dark);
    font-weight: 700;
  }

  .site-nav {
    position: absolute;
    top: 74px;
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero,
  .split,
  .auth-wrap,
  .dashboard,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .profile-grid,
  .counselor-grid,
  .stat-grid,
  .feature-grid.two {
    grid-template-columns: 1fr;
  }

  .calm-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-form,
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero,
  .page-hero,
  .section,
  .calm-band,
  .auth-wrap,
  .dashboard {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-copy h1,
  .page-hero h1,
  .dashboard h1 {
    font-size: 34px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn,
  .hero-actions .btn {
    width: 100%;
  }

  .bubble {
    width: 100%;
  }
}
