/**
 * Archivo CSS principal del sistema
 */

:root {
  --primary: #2C3E50;
  --accent: #E8A838;
  --bg: #F0F2F5;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
}

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  height: 100%;
}

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

body {
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', Arial, sans-serif;
  background: var(--bg);
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(44, 62, 80, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

nav .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-weight: bold;
  color: white;
  font-size: 1.2rem;
}

.logo img {
  max-width: 42px;
  border-radius: 8px;
}

nav .menu {
  display: flex;
  gap: 20px;
}

nav .menu a {
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  white-space: nowrap;
  transition: color 0.2s;
}

nav .menu a:hover {
  color: var(--accent);
}

nav .hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

nav .hamburger div {
  width: 24px;
  height: 2px;
  background-color: white;
  border-radius: 2px;
}

/* HEADER */
header {
  padding-top: 90px;
  padding-bottom: 40px;
  background: linear-gradient(135deg, #2C3E50 0%, #1a2a3a 60%, #0f1c28 100%);
  color: white;
  text-align: center;
  margin: 0;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232,168,56,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

header::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(232,168,56,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-badge {
  display: inline-block;
  background: rgba(232,168,56,0.15);
  border: 1px solid rgba(232,168,56,0.35);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

header h1,
header p {
  position: relative;
  z-index: 2;
}

header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -1px;
}

header h1 span {
  color: var(--accent);
}

header p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0;
}

/* MAIN */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px 20px 60px;
}

section {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 8px;
}

/* FEATURES */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.feature-card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.feature-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), #3d5166);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.feature-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

/* SEARCH CARD */
.search-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.search-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.search-card > p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 22px;
}

/* FORM */
.form {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0 0;
}

.form input[type="email"] {
  flex: 1;
  padding: 14px 18px;
  font-size: 0.95rem;
  border: 2px solid #e5e7eb;
  outline: none;
  border-radius: 12px 0 0 12px;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text);
}

.form input[type="email"]:focus {
  border-color: var(--primary);
  background: white;
}

.form input[type="email"]::placeholder {
  color: #b0b7c3;
}

.form button {
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), #3d5166);
  color: white;
  border: none;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.form button:hover {
  opacity: 0.9;
}

.form button:active {
  transform: scale(0.98);
}

/* LOADING */
.loading-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.loading-spinner {
  border: 3px solid #f0f0f0;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 380px;
  text-align: center;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content label {
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 4px;
}

#pin-input {
  width: 100%;
  padding: 14px;
  margin: 14px 0;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  transition: border-color 0.2s;
}

#pin-input:focus {
  border-color: var(--primary);
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.modal-buttons button {
  flex: 1;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-buttons button:first-child {
  background: var(--primary);
}

.modal-buttons button:last-child {
  background: #ef4444;
}

.modal-buttons button:hover {
  opacity: 0.88;
}

/* EMAIL PREVIEW */
.email-preview {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
  text-align: left;
}

.email-preview:empty {
  display: none;
}

.email-preview p {
  color: #ef4444;
  font-size: 0.9rem;
  text-align: center;
}

.email-preview h2 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 10px;
}

.email-preview hr {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 14px 0;
}

/* FOOTER */
footer {
  background-color: var(--primary);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
}

footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {

  nav .menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    top: 60px;
    right: 16px;
    background: var(--primary);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    padding: 14px;
    border-radius: 12px;
    min-width: 140px;
  }

  nav .menu.active {
    display: flex;
  }

  nav .hamburger {
    display: flex;
  }

  header h1 {
    font-size: 2.2rem;
  }

  header p {
    font-size: 1rem;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-card {
    padding: 22px 18px;
  }

  .form {
    flex-direction: row;
  }

  .form input[type="email"] {
    font-size: 0.9rem;
  }

  .form button {
    font-size: 0.9rem;
    padding: 14px 16px;
  }

}
