@import url("variables.css");

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

body.nuevo-page {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-body);
  background: var(--color-paper);
  color: var(--color-ink);
  display: flex;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
}

/* Marca, arriba del formulario */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.login-brand .mark { height: 48px; width: auto; }

.login-brand .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-ink);
}

/* Contenedor principal */
.contenedor {
  width: 100%;
  max-width: 640px;
}

.contenedor .card {
  background-color: var(--color-white);
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.6s ease-out forwards;
}

/* Título */
.titulo-mindra {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0 0 var(--space-1);
  text-align: center;
  color: var(--color-ink);
}

/* Intro */
.intro {
  font-size: 0.98rem;
  margin: 0 0 var(--space-5);
  text-align: center;
  color: var(--color-ink-soft);
  line-height: 1.6;
}

/* Formulario */
.formulario {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

fieldset {
  border: none;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-line);
}

fieldset:first-of-type {
  padding-top: 0;
  border-top: none;
}

legend {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-3);
  font-size: 1.05rem;
  padding: 0;
}

label {
  display: block;
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-ink);
}

label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink);
  background-color: var(--color-paper);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--color-ink-soft); opacity: 0.6; }

textarea { resize: vertical; min-height: 90px; font-family: var(--font-body); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(63, 169, 245, 0.18);
}

select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='%235C5754' height='24' viewBox='0 0 24 24' width='24'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 1.1rem;
  padding-right: 2.4rem;
}

/* Checkbox de privacidad — destacado, no perdido al final */
.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  background: var(--color-paper);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.checkbox-container input[type="checkbox"] {
  -webkit-appearance: checkbox;
  appearance: auto;
  width: 20px;
  height: 20px;
  padding: 0;
  cursor: pointer;
  margin-top: 2px;
  accent-color: var(--color-secondary);
  flex-shrink: 0;
}

.checkbox-container label {
  cursor: pointer;
  margin: 0;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--color-ink-soft);
}

.checkbox-container a {
  color: var(--color-secondary);
  font-weight: 600;
  text-decoration: none;
}

.checkbox-container a:hover { text-decoration: underline; }

/* Botón */
.btn {
  background: var(--gradient-main);
  color: var(--color-ink);
  border: none;
  padding: 14px 32px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
  align-self: center;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 3px; }

/* Flash mensajes */
.flash-mensajes {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.flash-mensajes li {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  animation: fadeUp 0.4s ease-out forwards;
}

.flash-mensajes .success { background-color: var(--color-success-bg); color: var(--color-success); }
.flash-mensajes .error { background-color: var(--color-error-bg); color: var(--color-error); }
.flash-mensajes .info { background-color: var(--color-info-bg); color: var(--color-info); }

/* Subida de foto de perfil */
.foto-upload { margin-bottom: var(--space-2); }
.foto-upload .foto-label { margin-top: 0; }

.foto-zona {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-paper);
  border: 1.5px dashed var(--color-line);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.foto-preview {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid var(--color-line);
  color: var(--color-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.foto-preview.con-foto { border: 3px solid var(--color-primary); }
.foto-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.foto-acciones { min-width: 0; }

/* El input real se oculta visualmente pero sigue siendo accesible y validable */
.foto-acciones input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.btn-foto {
  display: inline-block;
  margin: 0;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--gradient-main);
  color: var(--color-ink);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-foto:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.foto-acciones input[type="file"]:focus-visible + .foto-ayuda,
.foto-acciones:focus-within .btn-foto { outline: 2px solid var(--color-ink); outline-offset: 3px; }

.foto-ayuda {
  margin: var(--space-2) 0 0;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.foto-ayuda.error { color: var(--color-error); font-weight: 600; }

.btn:disabled { opacity: 0.7; cursor: wait; transform: none; }

/* Animaciones */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Responsividad */
@media (max-width: 600px) {
  .contenedor .card { padding: var(--space-4) var(--space-3); }
  .titulo-mindra { font-size: 1.4rem; }
  .foto-zona { flex-direction: column; text-align: center; }
}