@import url('https://fonts.googleapis.com/css2?family=Fromage&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f6f3ff;
  --surface: #ffffff;
  --primary: #7b4ee6;
  --primary-dark: #5b31c4;
  --text: #231f33;
  --muted: #6f6787;
  --border: #e6dcff;
  --font-primary: 'Fromage', 'Segoe UI', cursive;
  --font-secondary: 'Montserrat', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-secondary);
  background: linear-gradient(135deg, #fdfcff 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.brand,
.header-link,
.menu-toggle,
.cta,
.button,
.hero-title,
.card-title {
  font-family: var(--font-primary);
}

html {
  scroll-behavior: smooth;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(91, 49, 196, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 96px;
  width: auto;
  display: block;
}

.nav-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-link {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.header-link:hover {
  text-decoration: underline;
}

.menu-toggle {
  border: none;
  background: var(--primary);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-toggle span {
  width: 10px;
  height: 10px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.menu-toggle.active span {
  transform: rotate(-135deg);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.7rem);
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 0.7rem;
  box-shadow: 0 15px 35px rgba(35, 31, 51, 0.12);
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-menu a {
  text-decoration: none;
  color: var(--text);
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
  background: #f3ebff;
  color: var(--primary-dark);
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  flex: 1;
}

h1,
h2,
h3 {
  text-align: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 420px);
  gap: 2rem;
  padding: 3rem 0 2rem;
  align-items: center;
  justify-content: space-between;
}

.hero-content {
  max-width: 700px;
}

.hero-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-preview {
  position: fixed;
  right: 0;
  top: 280px;
  background: linear-gradient(135deg, #f4eeff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 28px 0 0 28px;
  padding: 1.6rem 1.5rem;
  box-shadow: -12px 0 28px rgba(91, 49, 196, 0.08);
  width: 330px;
  max-width: calc(100vw - 24px);
  border-left: 5px solid var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 4;
}

.hero-preview h3 {
  margin: 0.3rem 0 0.7rem;
  text-align: left;
  color: var(--primary-dark);
}

.hero-preview p {
  color: var(--muted);
  margin-bottom: 1rem;
  text-align: left;
}

.hero-preview .btn {
  display: inline-block;
  margin-top: 0.4rem;
}

.hero-text,
.about-card p,
.info-card p,
.post-card p,
.video-card p,
.footer p,
.auth-card p {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--primary-dark);
  background: #f0e9ff;
}

.hero-card,
.about-card,
.info-card,
.post-card,
.video-card,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: 0 10px 30px rgba(81, 47, 165, 0.08);
  width: min(100%, 460px);
}

.auth-card p {
  color: var(--muted);
}

.auth-card h2 {
  text-align: center;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  margin-bottom: 1rem;
}

.video-frame iframe,
.video-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.hero-card ul {
  margin-top: 0.8rem;
  padding-left: 1.1rem;
  color: var(--muted);
}

.section {
  padding: 2.5rem 0;
}

.section-title {
  margin-bottom: 1.2rem;
}

.about-layout {
  position: relative;
  display: block;
  min-height: 280px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.about-stack {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  width: 100%;
}

.cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.info-card,
.about-card {
  width: 100%;
}

.info-card h3,
.post-card h3,
.video-card h3,
.about-card h3,
.auth-card h3 {
  margin-bottom: 0.55rem;
}

.small-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.home-discussion-preview {
  padding-top: 1rem;
}

.discussion-preview-content {
  display: grid;
  grid-template-columns: 1fr;
  background: linear-gradient(135deg, #f5f1ff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 12px 35px rgba(91, 49, 196, 0.08);
}

.discussion-preview-content h2 {
  text-align: left;
  margin-bottom: 0.8rem;
}

.discussion-preview-content p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 2rem 0;
}

.auth-page.content-page {
  align-items: flex-start;
  min-height: auto;
  padding-bottom: 5rem;
}

.auth-page.content-page .content-section {
  width: 90%;
  max-width: 1000px;
  margin-top: 2rem;
  padding: 2rem 3rem;
}

.content-section {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.content-section h2 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.content-section p {
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.8;
  text-align: justify;
}

.content-section h3 {
  color: var(--primary-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
}

.content-section ul,
.content-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-section li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-form input {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
}

.checkbox-wrapper {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.checkbox-label span {
  color: var(--text);
}

.checkbox-label a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.checkbox-label a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.auth-helper {
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.auth-helper a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.posts-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(81, 47, 165, 0.08);
  overflow: hidden;
}

.post-accordion .accordion-header {
  background: linear-gradient(135deg, #fdfcff 0%, #f3ebff 100%);
  padding: 1.4rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.post-accordion .accordion-header:hover {
  background: linear-gradient(135deg, #f3ebff 0%, #e6dcff 100%);
}

.post-title-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.post-title-header h3 {
  margin: 0;
  text-align: left;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.comment-badge {
  background: var(--primary);
  color: white;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

.post-accordion .accordion-toggle {
  color: var(--primary);
}

.post-accordion .accordion-content {
  padding: 1.4rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.post-accordion.open .accordion-content {
  max-height: 5000px;
}

.comments-toggle {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
  margin-bottom: 1rem;
}

.comments-toggle:hover {
  background: var(--primary-dark);
}

.comments-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.comments-section.open {
  max-height: 2000px;
}

.topic-comments {
  margin-top: 0.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.comments-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.comment-item {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #f8f5ff;
  color: var(--text);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.4rem;
}

.comment-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.comment-author {
  font-weight: 700;
  color: var(--primary-dark);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.reply-toggle,
.view-replies-toggle,
.reply-button {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.comment-reply-form {
  margin-top: 0.8rem;
  display: none;
  gap: 0.6rem;
  flex-direction: column;
}

.comment-reply-form.visible {
  display: flex;
}

.comment-reply-form textarea {
  min-height: 80px;
}

.reply-list {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(123, 78, 230, 0.2);
}

.reply-list.hidden {
  display: none;
}

.reply-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
}

.reply-item .comment-header {
  margin-bottom: 0.3rem;
}

textarea {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  resize: vertical;
}

.schedule-info {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

.schedule-week-nav {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.week-arrow {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-dark);
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.week-arrow:hover {
  background: #f3ebff;
  transform: translateY(-1px);
}

.schedule-container {
  --schedule-time-col: 70px;
  --schedule-day-col: 170px;
  --schedule-day-count: 3;
  display: inline-block;
  width: max-content;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(91, 49, 196, 0.08);
  margin: 2rem auto 0;
  box-sizing: border-box;
}

.schedule-grid {
  display: flex;
  flex-direction: column;
  width: calc(var(--schedule-time-col) + (var(--schedule-day-col) * var(--schedule-day-count)));
}

.schedule-header {
  display: grid;
  grid-template-columns: var(--schedule-time-col) repeat(3, var(--schedule-day-col));
  gap: 0;
  background: var(--border);
  padding: 0;
  width: 100%;
}

.schedule-time-label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(123, 78, 230, 0.04);
  padding: 0.75rem 0.2rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  border-right: 1px solid var(--border);
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.schedule-day-header {
  background: linear-gradient(135deg, #fdfcff 0%, #f3ebff 100%);
  padding: 0.75rem 0.2rem;
  text-align: center;
  border-right: 1px solid var(--border);
}

.schedule-day-header:last-child {
  border-right: none;
}

.day-name {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.day-number {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.schedule-body {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.schedule-row {
  display: grid;
  grid-template-columns: var(--schedule-time-col) repeat(3, var(--schedule-day-col));
  gap: 0;
  background: var(--border);
  padding: 0;
  width: 100%;
}

.schedule-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.schedule-time {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(123, 78, 230, 0.04);
  padding: 0.8rem 0.1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--primary-dark);
  border-right: 1px solid var(--border);
}

.schedule-slot {
  min-width: 0;
  padding: 0.7rem 0.4rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
}

.schedule-split {
  background: rgba(123, 78, 230, 0.05);
  color: var(--primary-dark);
  padding: 0;
}

.slot-status-split {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-self: stretch;
  justify-self: stretch;
}

.slot-half {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.slot-half-occupied {
  background: rgba(255, 100, 100, 0.16);
  color: #b22d2d;
}

.slot-half-available {
  background: transparent;
  color: var(--primary-dark);
}

.slot-half-unavailable {
  background: transparent;
  color: #5f5f5f;
}

.schedule-slot:last-child {
  border-right: none;
}

.schedule-slot:hover {
  background: #f8f5ff;
  border-color: var(--border);
}

.schedule-disponivel {
  background: rgba(123, 78, 230, 0.05);
  color: var(--primary-dark);
}

.schedule-disponivel:hover {
  background: rgba(123, 78, 230, 0.15);
}

.schedule-ocupado {
  background: rgba(255, 100, 100, 0.1);
  color: #d33;
}

.schedule-ocupado:hover {
  background: rgba(255, 100, 100, 0.2);
}

.schedule-ocupado-half-top {
  background: linear-gradient(
    to bottom,
    rgba(255, 100, 100, 0.16) 0%,
    rgba(255, 100, 100, 0.16) 50%,
    rgba(123, 78, 230, 0.05) 50%,
    rgba(123, 78, 230, 0.05) 100%
  );
  color: #b54848;
}

.schedule-ocupado-half-bottom {
  background: linear-gradient(
    to bottom,
    rgba(123, 78, 230, 0.05) 0%,
    rgba(123, 78, 230, 0.05) 50%,
    rgba(255, 100, 100, 0.16) 50%,
    rgba(255, 100, 100, 0.16) 100%
  );
  color: #b54848;
}

.schedule-ocupado-half-top:hover {
  background: linear-gradient(
    to bottom,
    rgba(255, 100, 100, 0.24) 0%,
    rgba(255, 100, 100, 0.24) 50%,
    rgba(123, 78, 230, 0.1) 50%,
    rgba(123, 78, 230, 0.1) 100%
  );
}

.schedule-ocupado-half-bottom:hover {
  background: linear-gradient(
    to bottom,
    rgba(123, 78, 230, 0.1) 0%,
    rgba(123, 78, 230, 0.1) 50%,
    rgba(255, 100, 100, 0.24) 50%,
    rgba(255, 100, 100, 0.24) 100%
  );
}

.slot-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.schedule-legend {
  display: flex;
  gap: 2rem;
  justify-content: center;
  padding: 1.5rem;
  background: #f8f5ff;
  border-top: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.disponivel {
  background: rgba(123, 78, 230, 0.3);
  border: 2px solid var(--primary);
}

.legend-dot.meio {
  background: linear-gradient(
    to right,
    rgba(255, 100, 100, 0.45) 0%,
    rgba(255, 100, 100, 0.45) 50%,
    rgba(123, 78, 230, 0.35) 50%,
    rgba(123, 78, 230, 0.35) 100%
  );
  border: 2px solid #c26d6d;
}

.legend-dot.ocupado {
  background: rgba(255, 100, 100, 0.3);
  border: 2px solid #d33;
}

.footer {
  text-align: center;
  padding: 1.2rem 1rem 1.6rem;
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid var(--border);
  margin-top: auto;
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  main {
    padding: 1rem;
  }

  .about-layout {
    display: block;
    padding-right: 0;
    min-height: auto;
  }

  .hero-preview {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 1rem;
  }

  .topbar {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-logo {
    height: 64px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .auth-card,
  .hero-card,
  .about-card,
  .info-card,
  .post-card,
  .video-card {
    padding: 1.1rem;
  }

  .dropdown-menu {
    left: 0;
    right: auto;
    min-width: min(90vw, 220px);
  }

  .schedule-week-nav {
    gap: 0.55rem;
  }

  .week-arrow {
    width: 32px;
    height: 32px;
  }
}
