/* ECOLAW.AI Mobile PWA */
:root {
  --bg: #0b1a2a;
  --card: #132337;
  --primary: #2d7ff9;
  --primary-dark: #1a5fc4;
  --text: #e8eef5;
  --muted: #8fa3b8;
  --success: #22c55e;
  --error: #ef4444;
  --border: #243447;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.app { max-width: 480px; margin: 0 auto; padding: 16px; }

.header { text-align: center; margin-bottom: 20px; }
.logo { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--primary); }
.subtitle { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 { font-size: 1.1rem; margin: 0 0 14px; }

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 12px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px; /* tránh zoom iOS */
}

textarea { resize: vertical; min-height: 160px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.full { width: 100%; }

.hint { font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.hint.secure { text-align: center; }
.hint.warn { color: #f59e0b; text-align: center; font-weight: 600; }
.hint code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }

.meta { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.meta strong { color: var(--text); }

.result-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 10px;
}

.card.error { border-color: var(--error); }
.card.error h2 { color: var(--error); }

.hidden { display: none !important; }

.footer {
  text-align: center;
  padding: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer a { color: var(--primary); text-decoration: none; }

@media (max-width: 380px) {
  .app { padding: 12px; }
}
