:root {
  --bg: #f0f3f7;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5a6a7e;
  --border: #d5dde8;
  --accent: #1f6feb;
  --accent-hover: #1558c0;
  --danger: #c62828;
  --success: #1b7a3d;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.08);
  --font: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse at top left, #dce8f8 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, #e4eef8 0%, transparent 45%),
    var(--bg);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.header p {
  margin: 0 0 1.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type="file"] {
  font: inherit;
  font-weight: 400;
  padding: 0.4rem 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
}

.checkbox input {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.privacy-notice {
  padding: 0.95rem 1rem;
  border: 1px solid #c9d7ea;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #eef4fb;
}

.privacy-notice strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.privacy-notice p {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}

.privacy-notice p:last-child {
  margin-bottom: 0;
}

.link-btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent-hover);
}

.footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.privacy-dialog {
  width: min(92vw, 560px);
  max-height: min(85vh, 720px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}

.privacy-dialog::backdrop {
  background: rgba(26, 35, 50, 0.45);
}

.privacy-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.privacy-dialog-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.privacy-dialog-body {
  padding: 1rem 1.15rem 1.35rem;
  overflow: auto;
  max-height: calc(min(85vh, 720px) - 70px);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.privacy-dialog-body h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.95rem;
  color: var(--text);
}

.privacy-dialog-body p,
.privacy-dialog-body ul {
  margin: 0 0 0.55rem;
}

.privacy-dialog-body ul {
  padding-left: 1.2rem;
}

.meta-box {
  margin: 0.25rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #f7f9fc;
}

.meta-box summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.meta-hint {
  margin: 0.75rem 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.meta-list {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 0.45rem 0.85rem;
  margin: 0;
  font-size: 0.85rem;
}

.meta-list dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.meta-list dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.anexo-pdf {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  background: #f0f3f7;
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #eef7f1;
  border: 1px solid #c6e3d0;
  border-radius: 8px;
}

.auth-status p {
  margin: 0;
  color: var(--success);
}

.anexos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.anexo-item {
  width: 88px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.anexo-item img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.anexo-item span {
  display: block;
  padding: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  max-width: min(90vw, 420px);
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 100;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--accent);
}

@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
  }

  .auth-status {
    flex-direction: column;
    align-items: stretch;
  }
}
