:root {
  --primary: #006d77;
  --primary-dark: #005661;
  --secondary: #edf6f9;
  --text: #1a1a1a;
  --muted: #5f6368;
  --border: #d0d7de;
  --background: #f7fbfc;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background: var(--background);
  color: var(--text);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0;
  font-size: 2.5rem;
}

.subtitle {
  margin-top: 0.5rem;
  color: var(--muted);
}

.rules {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 20px 30px -20px rgba(0, 0, 0, 0.2);
  line-height: 1.6;
}

.rules ol {
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}

.rules li + li {
  margin-top: 0.75rem;
}

.primary,
.secondary {
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.6);
}

.primary:hover,
.primary:focus {
  background: var(--primary-dark);
}

.secondary {
  background: var(--secondary);
  color: var(--primary);
}

.secondary:hover,
.secondary:focus {
  background: #d8eef2;
}

.signature-card {
  margin-top: 3rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 40px -25px rgba(0, 0, 0, 0.3);
}

.signature-card.hidden {
  display: none;
}

.signature-card h2 {
  margin-top: 0;
  font-size: 1.75rem;
}

.small-print {
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  flex: 1 1 240px;
  gap: 0.5rem;
  font-weight: 600;
}

.field input {
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfe;
}

.signature-area {
  border: 1px dashed var(--primary);
  border-radius: 12px;
  background: var(--secondary);
  padding: 1rem;
}

.signature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.canvas-wrapper {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #fff;
  overflow: hidden;
  min-height: 240px;
}

canvas {
  width: 100%;
  height: 240px;
  display: block;
  touch-action: none;

  /* extras para iOS/Safari antiguos */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
} 

.status-message {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background: #d1fae5;
  color: #065f46;
}

.status-message.error {
  background: #fee2e2;
  color: #7f1d1d;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }

  .signature-card {
    padding: 1.5rem;
  }

  .signature-area {
    padding: 0.75rem;
  }
}

.rules-subtitle { color: var(--muted); margin-top: 0.25rem; }
.rules-declaration { margin-top: 1rem; font-weight: 600; }
