/* ============================================================
   Style completo - mobile first
   Modo oscuro FULL (texto siempre blanco)
   Inputs con iconos
   Modal overlay con blur + dark overlay
============================================================ */

/* Tipografía */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap');

:root{
  --accent: #2196F3;
  --accent-dark: #1976D2;
  --success: #28a745;
  --bg: #f3f3f3;
  --card-bg: #fff;
  --muted: #666;
}

/* Global */
*{
  box-sizing: border-box;
}
html, body{
  height:100%;
}
body{
  margin:0;
  font-family:"Open Sans", Arial, sans-serif;
  background:var(--bg);
  color:#222;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  transition:background .25s, color .25s;
}

/* ============================================================
   DARK MODE — FORZADO A BLANCO SIEMPRE
============================================================ */
@media (prefers-color-scheme: dark){

  :root{
    --bg:#121212;
    --card-bg:#1e1e1e;
    --muted:#ccc;
  }

  body{
    color:#fff !important;
    background:#121212 !important;
  }

  /* Texto general */
  h1, h2, h3, h4, h5, h6,
  p, label, span, div,
  .titulo, .subtitulo, .msg, .check {
    color:#fff !important;
  }

  /* Inputs y selects */
  input, select{
    background:#222 !important;
    color:#fff !important;
    border-color:#555 !important;
  }

  /* Placeholders */
  input::placeholder{
    color:#ccc !important;
  }

  /* Íconos */
  .material-icons{
    color:#fff !important;
  }

  /* Precio box */
  .precio-box{
    background:#2a2a2a !important;
    color:#fff !important;
  }

  /* Form container */
  .form-container{
    background:#1e1e1e !important;
  }

  /* Modal */
  .modal-success{
    background:#1e1e1e !important;
    color:#fff !important;
  }
}

/* ============================================================
   Page structure
============================================================ */

.page-wrapper{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
  min-height:100vh;
  padding:22px 16px;
}

/* HEADER */
.site-header{
  text-align:center;
  margin-top:6px;
  margin-bottom:2px;
  opacity:0;
  transform:translateY(-12px);
  animation:fadeSlide .7s ease-out forwards;
}

.logo{
  width:100px;
  height:100px;
  display:block;
  margin:0 auto 8px auto;
  border-radius:8px;
  object-fit:contain;
}

.titulo{
  font-size:20px;
  font-weight:600;
  margin:2px 0;
  color:inherit;
}

.subtitulo{
  font-size:14px;
  margin:0;
  color:var(--muted);
}

/* Form area */
.form-area{
  width:100%;
  display:flex;
  justify-content:center;
}

.form-container{
  width:90%;
  max-width:430px;
  background:var(--card-bg);
  padding:20px;
  border-radius:12px;
  box-shadow:0 6px 20px rgba(0,0,0,0.08);
  transition:transform .18s, box-shadow .18s, background .18s;
}

/* ============================================================
   Inputs con íconos
============================================================ */
.input-group{
  position:relative;
  margin-bottom:18px;
}

.input-group .material-icons{
  position:absolute;
  left: calc(15% - 22px);
  top:50%;
  transform:translateY(-50%);
  font-size:22px;
  color:var(--muted);
}

.input-group input,
.input-group select{
  width:70%;
  display:block;
  margin:0 auto;
  padding:12px 12px 12px 42px;
  font-size:15px;
  border-radius:8px;
  border:1px solid #bdbdbd;
  background:transparent;
  transition:transform .15s ease, border-color .15s;
}

.input-group input::placeholder{
  color:#999;
}

.input-group input:focus,
.input-group select:focus{
  transform:scale(1.03);
  border-color:var(--accent);
  outline:none;
  box-shadow:0 4px 18px rgba(33,150,243,0.08);
}

/* Bordes según validación */
.input-group input:invalid{
  border-color:#d9534f;
}
.input-group input:valid{
  border-color:var(--success);
}

/* ============================================================
   Precio
============================================================ */
.precio-box{
  width:70%;
  margin:10px auto;
  background:#eee;
  padding:10px;
  border-radius:8px;
  text-align:center;
}

/* ============================================================
   Botón + ripple
============================================================ */
button{
  width:70%;
  margin:14px auto 0 auto;
  display:block;
  padding:14px 18px;
  background:var(--accent);
  color:#fff;
  border:0;
  border-radius:10px;
  font-weight:600;
  font-size:16px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
}
button:hover{
  background:var(--accent-dark);
}

button:active::after{
  content:"";
  position:absolute;
  width:160px;
  height:160px;
  border-radius:50%;
  background:rgba(255,255,255,0.45);
  left:calc(var(--x) - 80px);
  top:calc(var(--y) - 80px);
  animation:ripple .6s linear;
}

@keyframes ripple{
  from{transform:scale(0);opacity:1}
  to{transform:scale(3);opacity:0}
}

/* Resultado */
#resultado{
  width:70%;
  margin:12px auto 0 auto;
  text-align:center;
}

/* Anim header */
@keyframes fadeSlide{
  from{opacity:0;transform:translateY(-12px)}
  to{opacity:1;transform:translateY(0)}
}

/* ============================================================
   OVERLAY + MODAL SUCCESS
============================================================ */

.overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.25);
  z-index:1200;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
}

.overlay.visible{
  opacity:1;
  pointer-events:auto;
}

.modal-success{
  min-width:240px;
  max-width:92%;
  padding:22px 26px;
  background:var(--card-bg);
  border-radius:12px;
  text-align:center;
  box-shadow:0 8px 36px rgba(0,0,0,0.28);
  transform:translateY(8px) scale(0.98);
  opacity:0;
  transition:transform .25s ease, opacity .25s ease;
}

.overlay.visible .modal-success{
  transform:translateY(0) scale(1);
  opacity:1;
}

.modal-success .check{
  font-size:28px;
  color:var(--success);
  font-weight:700;
  margin-bottom:8px;
}

.modal-success .msg{
  font-size:18px;
  font-weight:700;
}

/* BLUR del fondo cuando modal está activo */
.page-blurred .page-wrapper{
  filter:blur(6px) brightness(.88);
  transition:filter .25s;
}

.hidden{
  display:none !important;
}

/* ============================================================
   Desktop improvements
============================================================ */
@media screen and (min-width:900px){

  .page-wrapper{
    align-items:center;
    padding-top:32px;
    padding-bottom:48px;
  }

  .site-header{
    margin-bottom:18px;
  }

  .form-area{
    display:flex;
    justify-content:center;
    width:100%;
  }

  .form-container{
    width:60%;
    max-width:680px;
    padding:28px;
  }

  .input-group .material-icons{
    left: calc(15% - 30px);
  }

  .logo{
    width:110px;
    height:110px;
  }

  .titulo{
    font-size:22px;
  }
}

body.fade-out {
    opacity: 0;
    transition: opacity 1s ease;
}