:root {
  --orange: #FF6B45;
  --orange-dark: #E5502C;
  --gradient: linear-gradient(135deg, #FF8A50, #FF3D68);
  --navy: #1B1B2F;
  --navy-soft: #3A3A55;
  --bg: #FFF8F5;
  --card: #FFFFFF;
  --border: #F0E2DC;
  --danger: #D64545;
  --success: #2E9E6B;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--navy);
  height: 100%;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

.view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- LOGIN ---------- */
#view-login {
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  padding: 24px;
}

.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(27, 27, 47, 0.25);
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 12px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  color: var(--navy);
}

.subtitle {
  color: var(--navy-soft);
  margin: 0 0 20px;
  font-size: 0.9rem;
}

#form-login {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 4px;
}

#form-login label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-soft);
  margin-top: 10px;
}

#form-login input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
}

#form-login input:focus {
  border-color: var(--orange);
}

.btn-primary {
  margin-top: 20px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--bg);
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  font-weight: 600;
  cursor: pointer;
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
}

/* ---------- APP PRINCIPAL ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--navy-soft);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  background: var(--card);
}

.tab {
  border: none;
  background: var(--bg);
  color: var(--navy-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: var(--orange);
  color: white;
}

#list-container {
  flex: 1;
  padding: 16px 20px 100px;
}

#reminder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reminder-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.reminder-item.done {
  opacity: 0.55;
}

.reminder-item.done .reminder-title {
  text-decoration: line-through;
}

.reminder-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--orange);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.reminder-item.done .reminder-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.reminder-body { flex: 1; min-width: 0; }

.reminder-title {
  font-weight: 700;
  margin: 0 0 2px;
  word-break: break-word;
}

.reminder-meta {
  font-size: 0.8rem;
  color: var(--navy-soft);
}

.reminder-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  color: var(--navy-soft);
  margin-top: 60px;
  padding: 0 20px;
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: white;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(255, 61, 104, 0.4);
  cursor: pointer;
}

/* ---------- MODAIS ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 27, 47, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.modal {
  background: var(--card);
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 28px;
  animation: slide-up 0.2s ease-out;
}

@media (min-width: 540px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; }
}

@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal h2 {
  margin: 0 0 6px;
}

.hint {
  color: var(--navy-soft);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.modal label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-soft);
  margin-top: 12px;
  margin-bottom: 4px;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
  resize: vertical;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--orange);
}

.voice-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.voice-row textarea { flex: 1; }

.btn-mic {
  width: 52px;
  border-radius: 12px;
  border: none;
  background: var(--gradient);
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-mic.recording {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 104, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(255, 61, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 104, 0); }
}

.mic-status {
  color: var(--orange-dark);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 8px 0 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions button { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
