:root {
  color-scheme: light;
  font-family: Arial, "Segoe UI", sans-serif;
  background: #edf3f1;
  color: #172126;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
}

main {
  width: min(1060px, 100%);
  position: relative;
  z-index: 1;
}

.ambient-wave {
  position: fixed;
  inset: auto -10% 0 -10%;
  height: 38vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
}

.ambient-wave span {
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  border-radius: 50%;
  border-top: 2px solid rgba(23, 106, 120, 0.24);
  animation: drift 8s ease-in-out infinite;
}

.ambient-wave span:nth-child(1) { bottom: 12px; animation-delay: 0s; }
.ambient-wave span:nth-child(2) { bottom: 54px; animation-delay: 0.4s; }
.ambient-wave span:nth-child(3) { bottom: 98px; animation-delay: 0.8s; }
.ambient-wave span:nth-child(4) { bottom: 142px; animation-delay: 1.2s; }
.ambient-wave span:nth-child(5) { bottom: 186px; animation-delay: 1.6s; }

@keyframes drift {
  0%, 100% { transform: translateX(-24px) scaleY(0.9); }
  50% { transform: translateX(24px) scaleY(1.16); }
}

.hero,
.recording-card,
.login-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d7e1df;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(25, 45, 52, 0.10);
  backdrop-filter: blur(8px);
}

.hero {
  padding: 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-symbol {
  width: 96px;
  height: 96px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 18px rgba(10, 42, 48, 0.16));
  animation: symbolBreathe 3.8s ease-in-out infinite;
}

.symbol-guide {
  display: flex;
  align-items: center;
  gap: 12px;
}

@keyframes symbolBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

h1 {
  margin: 0;
  font-size: 38px;
}

p {
  margin: 6px 0 0;
  color: #4d5f64;
}

.goal {
  margin-top: 20px;
  max-width: 820px;
  color: #33494f;
  font-size: 18px;
  line-height: 1.55;
}

.mode-tabs,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: #176a78;
  color: #ffffff;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 16px rgba(23, 106, 120, 0.14);
}

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

button.secondary {
  background: #506068;
}

button.danger {
  background: #9c2e2e;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.mode-tab {
  background: #d8e4e2;
  color: #1b3035;
  box-shadow: none;
}

.mode-tab.active {
  background: #176a78;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(23, 106, 120, 0.14);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.sentence-card,
.free-card {
  min-height: 154px;
  background: #f7faf9;
  border: 1px solid #cad6d4;
  border-radius: 10px;
  padding: 22px;
}

.sentence-card {
  font-family: Arial, "Times New Roman", serif;
  font-size: 35px;
  line-height: 1.48;
  direction: rtl;
  text-align: right;
  display: flex;
  align-items: center;
  position: relative;
}

.sentence-card.loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #c6d6d5;
  border-top-color: #176a78;
  animation: spin 0.9s linear infinite;
  margin-inline-start: 12px;
}

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

.free-card {
  color: #344a50;
  font-size: 18px;
  line-height: 1.55;
}

.source-label,
.status {
  min-height: 24px;
  color: #38535c;
  font-weight: 700;
}

.recording-card {
  margin-top: 16px;
  padding: 22px;
}

.account-line {
  color: #475b61;
}

.link-button {
  background: transparent;
  color: #176a78;
  padding: 0 8px 0 0;
  font-size: 14px;
  box-shadow: none;
}

.meter {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.meter i {
  width: 8px;
  height: 16px;
  border-radius: 999px;
  background: #b5c9ca;
  transition: background 0.2s ease;
}

.meter.recording i {
  background: #176a78;
  animation: pulse 0.75s ease-in-out infinite;
}

.meter.recording i:nth-child(2) { animation-delay: 0.08s; }
.meter.recording i:nth-child(3) { animation-delay: 0.16s; }
.meter.recording i:nth-child(4) { animation-delay: 0.24s; }
.meter.recording i:nth-child(5) { animation-delay: 0.32s; }
.meter.recording i:nth-child(6) { animation-delay: 0.40s; }
.meter.recording i:nth-child(7) { animation-delay: 0.48s; }

@keyframes pulse {
  0%, 100% { height: 14px; }
  50% { height: 46px; }
}

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #b9c6cc;
  border-radius: 8px;
  padding: 12px;
  font-size: 18px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  direction: rtl;
  text-align: right;
  font-family: Arial, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.45;
}

.consent-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.consent-row input {
  width: 20px;
  height: 20px;
}

audio {
  width: 100%;
  margin-top: 10px;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(238, 243, 242, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: min(480px, 100%);
  padding: 28px;
}

.login-card .symbol-guide {
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .symbol-guide {
    align-items: flex-start;
  }

  .brand-row .symbol-guide {
    flex-direction: column;
  }

  .sentence-card {
    font-size: 26px;
  }

  h1 {
    font-size: 30px;
  }
}
