:root {
  --festival-black: #111111;
  --festival-blue: #1945c7;
  --festival-green: #1f9d55;
  --festival-red: #d64545;
  --festival-sand: #cecac7;
  --festival-sand-soft: #ebe8e5;
  --festival-white: #f8f6f4;
  --festival-shadow: 0 24px 60px rgba(17, 17, 17, 0.12);
  --festival-radius: 24px;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--festival-black);
  font-family: "Source Sans 3", sans-serif;
  background:
    radial-gradient(circle at top, rgba(25, 69, 199, 0.14), transparent 34%),
    linear-gradient(180deg, #f3f1ee 0%, #e8e3df 100%);
}

a {
  color: inherit;
}

h1,
h2,
h3,
strong,
.brand-lockup,
.eyebrow,
.badge-soft,
.show-pill,
.score-pill,
.pending-pill {
  font-family: "Space Grotesk", sans-serif;
}

.app-frame {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0;
}

.brand-lockup {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
}

.brand-kicker,
.eyebrow,
.summary-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(17, 17, 17, 0.15);
  border-radius: 999px;
  background: rgba(248, 246, 244, 0.72);
  font-weight: 700;
}

.main-shell {
  padding: 1rem;
}

.auth-shell{
    display:flex;
    justify-content: center;
}

.auth-shell,
.page-shell {
  width: min(100%, 72rem);
  margin: 0 auto;
}

.auth-panel,
.page-hero,
.session-panel,
.empty-state {
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: var(--festival-radius);
  box-shadow: var(--festival-shadow);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-brand {
  padding: 1.5rem;
  border-radius: var(--festival-radius);
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(25, 69, 199, 0.94)),
    var(--festival-black);
  color: var(--festival-white);
}

.auth-brand h1,
.page-hero h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 0.98;
}

.auth-brand p,
.page-hero p,
.card-heading p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
}

.auth-card,
.session-panel,
.presentation-card,
.empty-state {
  background: rgba(248, 246, 244, 0.9);
  backdrop-filter: blur(12px);
}

.auth-card {
  padding: 1.5rem;
  border-radius: var(--festival-radius);
}

.card-heading {
  margin-bottom: 1rem;
}

.card-heading h2 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.6rem;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(25, 69, 199, 0.12);
  color: var(--festival-blue);
  font-size: 0.8rem;
}

.stack-form,
.evaluation-form {
  display: grid;
  gap: 1rem;
}

.evaluation-form {
  position: relative;
}

.field-block {
  display: grid;
  gap: 0.4rem;
}

.field-block label {
  font-weight: 700;
}

.festival-input,
.festival-textarea,
.festival-select {
  min-height: 3.25rem;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 18px;
  background: #fff;
  font-size: 1rem;
}

.festival-input:focus,
.festival-textarea:focus,
.festival-select:focus {
  border-color: rgba(25, 69, 199, 0.7);
  box-shadow: 0 0 0 0.18rem rgba(25, 69, 199, 0.15);
}

.festival-textarea {
  min-height: 9rem;
  resize: vertical;
}

.festival-button {
  min-height: 3.35rem;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--festival-blue), #2b66ff);
  font-weight: 700;
}

.evaluation-form.is-submitting > *:not(.save-overlay) {
  pointer-events: none;
}

.evaluation-form.is-submitting .festival-button,
.evaluation-form.is-submitting .festival-input,
.evaluation-form.is-submitting .festival-select,
.evaluation-form.is-submitting .media-control,
.evaluation-form.is-submitting .audio-preview {
  opacity: 0.6;
}

.save-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(248, 246, 244, 0.82);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.save-overlay[hidden] {
  display: none;
}

.save-overlay-card {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  width: min(100%, 22rem);
  padding: 1.2rem 1.1rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 50px rgba(17, 17, 17, 0.14);
  text-align: center;
}

.save-overlay-card strong {
  font-size: 1.02rem;
}

.save-overlay-card p {
  margin: 0;
  color: rgba(17, 17, 17, 0.72);
}

.save-spinner {
  width: 2.35rem;
  height: 2.35rem;
  border: 3px solid rgba(25, 69, 199, 0.15);
  border-top-color: var(--festival-blue);
  border-radius: 50%;
  animation: save-spin 0.8s linear infinite;
}

.soft-alert {
  margin: 1rem 0 0;
  border: 0;
  border-radius: 18px;
}

.validation-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.page-shell {
  display: grid;
  gap: 1rem;
}

.page-hero {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.97), rgba(25, 69, 199, 0.92)),
    var(--festival-black);
  color: var(--festival-white);
}

.hero-meta {
  display: grid;
  gap: 0.75rem;
}

.jurado-chip {
  display: inline-grid;
  gap: 0.2rem;
  justify-content: start;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(248, 246, 244, 0.15);
  border-radius: 20px;
  background: rgba(248, 246, 244, 0.08);
}

.hero-logout {
    border: 1px solid rgba(25, 69, 199);
    color: black;
    min-height: 3rem;
    border-radius: 18px;
}

.session-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.session-picker {
  display: grid;
  gap: 0.45rem;
}

.session-picker label {
  font-weight: 700;
}

.session-summary,
.meta-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.session-summary > div,
.meta-grid > div {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: var(--festival-sand-soft);
}

.presentation-list {
  display: grid;
  gap: 1rem;
}

.presentation-card {
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: var(--festival-radius);
  box-shadow: var(--festival-shadow);
}

.presentation-card summary {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  list-style: none;
  cursor: pointer;
}

.presentation-card summary::-webkit-details-marker {
  display: none;
}

.presentation-card[open] summary {
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.presentation-card h2 {
  margin: 0.3rem 0 0.2rem;
  font-size: 1.45rem;
}

.presentation-card p {
  margin: 0;
  opacity: 0.78;
}

.card-index {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--festival-blue);
}

.card-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.show-pill,
.score-pill,
.pending-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
}

.show-pill {
  background: rgba(25, 69, 199, 0.12);
  color: var(--festival-blue);
}

.score-pill {
  background: rgba(17, 17, 17, 0.9);
  color: var(--festival-white);
}

.pending-pill {
  background: rgba(206, 202, 199, 0.95);
}

.presentation-body {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
}

.audio-recorder {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(31, 157, 85, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 232, 229, 0.92));
}

.recorder-topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.recorder-stage {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 240, 237, 0.94));
}

.recorder-display {
  display: grid;
  gap: 0.45rem;
}

.recording-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  color: var(--festival-black);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.recording-badge::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.24);
}

.recorder-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.media-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 18px 36px rgba(17, 17, 17, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.media-control:hover:not(:disabled),
.media-control:focus-visible:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 22px 44px rgba(17, 17, 17, 0.18);
}

.media-control:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.media-control svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.media-control-play {
  background: linear-gradient(135deg, #1f9d55, #2dc76d);
}

.media-control-pause {
  background: linear-gradient(135deg, #f0a81f, #f5c04d);
}

.media-control-stop {
  background: linear-gradient(135deg, #d64545, #ef5f5f);
}

.recorder-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--festival-black);
  color: var(--festival-white);
  font-weight: 700;
}

.voice-visualizer {
  position: relative;
  min-height: 7rem;
  padding: 0.5rem 0.75rem;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(11, 16, 24, 0.98), rgba(18, 24, 33, 0.96)),
    #111111;
  border: 1px solid rgba(124, 247, 178, 0.08);
}

.voice-visualizer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.025)),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(10% - 1px),
      rgba(255, 255, 255, 0.045) calc(10% - 1px),
      rgba(255, 255, 255, 0.045) 10%
    );
  opacity: 0.55;
  pointer-events: none;
}

.voice-visualizer::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 50%;
  height: 1px;
  background: rgba(170, 186, 203, 0.16);
  transform: translateY(-50%);
  pointer-events: none;
}

.voice-waveform {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 7rem;
  opacity: 0.96;
}

.recorder-helper,
.helper-text,
.transcription-status {
  margin: 0;
  font-size: 0.95rem;
}

.recorder-helper {
  color: rgba(17, 17, 17, 0.74);
}

.audio-preview {
  width: 100%;
}

.audio-recorder[data-recording-state="recording"] .recording-badge {
  background: rgba(31, 157, 85, 0.14);
  color: var(--festival-green);
}

.audio-recorder[data-recording-state="recording"] .recording-badge::before {
  animation: pulse-recording 1.4s infinite;
}

.audio-recorder[data-recording-state="recording"] .voice-visualizer {
  box-shadow:
    inset 0 0 0 1px rgba(115, 240, 167, 0.16),
    0 18px 32px rgba(18, 29, 39, 0.14);
}

.audio-recorder[data-recording-state="paused"] .recording-badge {
  background: rgba(240, 168, 31, 0.14);
  color: #b56d00;
}

.audio-recorder[data-recording-state="paused"] .voice-visualizer {
  border-color: rgba(240, 168, 31, 0.2);
}

.audio-recorder[data-recording-state="ready"] .recording-badge {
  background: rgba(25, 69, 199, 0.12);
  color: var(--festival-blue);
}

.audio-recorder[data-recording-state="ready"] .voice-visualizer {
  border-color: rgba(25, 69, 199, 0.18);
}

@keyframes pulse-recording {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.35);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(31, 157, 85, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(31, 157, 85, 0);
  }
}

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

.empty-state {
  padding: 2rem 1.4rem;
  text-align: center;
}

code {
  color: var(--festival-blue);
}

@media (min-width: 768px) {
  .topbar {
    padding: 1.25rem 1.5rem 0;
  }

  .main-shell {
    padding: 1.5rem;
  }

  .auth-panel {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: stretch;
  }

  .page-hero {
    grid-template-columns: 1.6fr auto;
    align-items: end;
  }

  .session-panel {
    grid-template-columns: 1.25fr 0.75fr;
    align-items: end;
  }

  .presentation-card summary {
    grid-template-columns: 1.3fr auto;
    align-items: center;
  }

  .meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
