/* ============================================
   styles.css — Encuentra Mi Mascota
   Estilos compartidos entre index.html y q.html
   ============================================ */

/* Variables */
:root {
  --primary: #A9D6E5;
  --accent: #F4978E;
  --background: #FDFDF9;
  --text: #2E4A62;
  --error: #f44336;
  --warning: #ff9800;
  --warning-soft: #FFCC80;
  --success-bg: #e8f5e8;
  --success-text: #2e7d32;
}

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

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--primary), #D0EBF2);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
}

/* ---- Header ---- */
.header {
  background: linear-gradient(135deg, var(--primary), #D0EBF2);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header img {
  max-width: 70%;
  height: auto;
}

.header .subtitle {
  margin: 0.5rem 0 0 0;
  font-size: 1rem;
  color: var(--text);
  opacity: 0.85;
  font-weight: 300;
}

/* ---- Main content ---- */
.main-content {
  flex: 1;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Mensajes de estado ---- */
.msg-error {
  color: var(--error);
  background: #ffebee;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.msg-success {
  color: var(--success-text);
  background: var(--success-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.msg-info {
  background-color: #e3f2fd;
  color: #1565c0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.95rem;
  border-left: 4px solid #2196f3;
}

/* ---- Formularios ---- */
form {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  max-width: 480px;
  margin: 1rem auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section {
  margin-bottom: 3rem;
}

h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

p {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.field-group {
  margin-bottom: 1.25rem;
}

.field-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.required::after {
  content: " *";
  color: var(--error);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* ---- File input ---- */
.file-input {
  display: none;
}

.file-input-label {
  display: block;
  padding: 0.75rem;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.file-input-label:hover {
  background: #e8f4fd;
  border-color: var(--primary);
}

.image-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: 10px;
  margin-top: 10px;
  object-fit: cover;
  display: none;
}

/* ---- Progress bar ---- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
  display: none;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* ---- Botones ---- */
button,
.btn {
  display: inline-block;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.15s ease;
  text-decoration: none;
  text-align: center;
}

button:hover,
.btn:hover {
  background: var(--accent);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-pill {
  width: auto;
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
}

.btn-whatsapp {
  background: #25D366;
}

.btn-whatsapp:hover {
  background: #1ebe57;
}

/* ---- Footer ---- */
.footer {
  background: #333;
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  margin-top: auto;
}

.footer h3 {
  margin: 0 0 1rem 0;
  color: var(--accent);
  font-size: 1.2rem;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 8px;
}

.contact-item strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

.contact-item a {
  color: white;
  text-decoration: none;
}

.contact-item a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid #555;
  padding-top: 1rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ---- Card (q.html) ---- */
.card {
  background: var(--background);
  padding: 2rem;
  border-radius: 20px;
  max-width: 500px;
  margin: 2rem auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.pet-photo {
  width: 100%;
  max-width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.pet-name {
  font-size: 1.5rem;
  color: var(--text);
  font-weight: bold;
}

.info-section {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  text-align: left;
  border: 1px solid #eee;
}

.info-item {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.info-label {
  font-weight: bold;
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.info-value {
  color: #444;
  line-height: 1.4;
}

.contact-section {
  background: #e6f5f3;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  border-left: 5px solid var(--primary);
  text-align: left;
}

.contact-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 1rem;
}

.phone-number {
  font-size: 1rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.medical-alert {
  background: #fff8e1;
  border: 2px solid var(--warning-soft);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  text-align: left;
}

.medical-alert h3 {
  color: #7f5f00;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.medical-alert p {
  color: #7f5f00;
  margin: 0;
  font-size: 0.95rem;
}

.notification-sent {
  background: var(--success-bg);
  color: var(--success-text);
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ---- Loading ---- */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text);
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid #ddd;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  body {
    padding: 0;
  }

  .card {
    padding: 1.25rem;
    margin: 1rem auto;
  }

  .pet-photo {
    height: 220px;
  }

  form {
    padding: 1rem;
  }

  .main-content {
    padding: 1rem 0.5rem;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }
}
