/* ==========================================================================
   ESTILOS - Formulario CPHS "TAS" - Resiter Industrial S.A.
   ========================================================================== */

:root{
  --azul-oscuro:#1a2b38;
  --azul-medio:#0f6ba8;
  --azul-brillante:#137cc1;
  --azul-texto:#0d5a90;
  --dorado:#b18848;
  --dorado-claro:#c9a35f;
  --crema:#fbfaf5;
  --crema-borde:#e2e2e5;
  --gris-fondo:#f3f4f8;
  --gris-texto:#5b6570;
  --rojo:#e0304a;
  --amarillo:#f5a623;
  --verde:#2e9e4f;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  background: var(--gris-fondo);
  color:#222;
}

.page{
  max-width: 480px;
  margin: 0 auto;
  background: var(--gris-fondo);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  transition: max-width 0.2s ease;
}

.page::before{
  content:"";
  position:absolute;
  top:0; left:0; right:0; bottom:0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(15,107,168,0.035) 0px,
    rgba(15,107,168,0.035) 2px,
    transparent 2px,
    transparent 18px
  );
  pointer-events:none;
  z-index:0;
}

.page > *{ position: relative; z-index: 1; }

/* ===== HEADER ===== */
header.top-bar{
  display:flex;
  align-items:center;
  gap:14px;
  padding: 22px 18px;
  background: linear-gradient(90deg, #333d43 0%, #12558a 55%, #137cc1 100%);
  color:#fff;
}

.logo-resiter{
  flex:0 0 auto;
  width:64px;
  height:64px;
  background:#fff;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.logo-resiter svg{ width:46px; height:46px; }

.logo-comite{
  flex:0 0 auto;
  width:58px;
  height:58px;
  border-radius:50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.top-bar .titles{
  flex:1 1 auto;
  min-width:0;
}
.top-bar .titles h1{
  margin:0;
  font-size:19px;
  line-height:1.25;
  font-weight:800;
}
.top-bar .titles p{
  margin:2px 0 0;
  font-size:13.5px;
  font-weight:400;
  color:#eaf3fb;
}

/* ===== HERO ===== */
.hero{
  text-align:center;
  padding: 30px 26px 22px;
}
.pill-badge{
  display:inline-block;
  background: linear-gradient(90deg, var(--dorado), var(--dorado-claro));
  color:#fff;
  font-size:12.5px;
  font-weight:700;
  letter-spacing:1px;
  padding:7px 20px;
  border-radius: 30px;
  box-shadow: 0 3px 8px rgba(177,136,72,0.35);
}
.hero h2{
  color:#134b6e;
  font-size:27px;
  font-weight:800;
  line-height:1.25;
  margin: 16px 0 12px;
}
.hero p{
  color: var(--gris-texto);
  font-size:15px;
  line-height:1.5;
  margin:0 auto;
  max-width: 380px;
}

/* ===== QR CARD ===== */
.qr-card{
  margin: 6px 18px 26px;
  padding: 22px 20px 26px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3a4046 0%, #234a63 55%, #1c4c66 100%);
  color:#fff;
  text-align:center;
  box-shadow: 0 8px 20px rgba(20,40,55,0.25);
}
.qr-card h3{
  margin:0 0 8px;
  font-size:19px;
  font-weight:800;
}
.qr-card p{
  margin:0 0 18px;
  font-size:14px;
  color:#cfe0ea;
  line-height:1.45;
}
.qr-box{
  background:#fff;
  display:inline-block;
  padding:14px;
  border-radius:14px;
}
.qr-box img{
  display:block;
  width:170px;
  height:170px;
}

/* ===== FORM CARD ===== */
.form-card{
  background:#fff;
  margin: 0 18px 20px;
  padding: 24px 20px 26px;
  border-radius: 18px;
  border: 1px solid #e7e9ee;
  box-shadow: 0 6px 18px rgba(20,40,55,0.06);
}

.field-label{
  display:block;
  color: var(--azul-texto);
  font-size:13px;
  font-weight:800;
  letter-spacing:0.6px;
  text-transform:uppercase;
  margin: 22px 0 10px;
}
.form-card .field-label:first-child{ margin-top:0; }

.categorias{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cat-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  background: var(--crema);
  border: 1.5px solid var(--crema-borde);
  border-radius: 14px;
  padding: 18px 10px;
  cursor:pointer;
  font-size:14.5px;
  font-weight:700;
  color:#3a3a3a;
  transition: all 0.15s ease;
  user-select:none;
}
.cat-btn .icon{ font-size:24px; line-height:1; }
.cat-btn:hover{ border-color:#c9ccd3; }
.cat-btn.selected{
  border-color: var(--azul-medio);
  background: #eaf4fb;
  box-shadow: 0 0 0 2px rgba(15,107,168,0.15);
  color: var(--azul-texto);
}

input[type="text"], textarea{
  width:100%;
  background: var(--crema);
  border: 1.5px solid var(--crema-borde);
  border-radius: 12px;
  padding: 14px 14px;
  font-size:14.5px;
  font-family: inherit;
  color:#333;
  resize: vertical;
}
input[type="text"]::placeholder, textarea::placeholder{
  color:#9a9a95;
}
input[type="text"]:focus, textarea:focus{
  outline:none;
  border-color: var(--azul-medio);
  box-shadow: 0 0 0 3px rgba(15,107,168,0.12);
}
textarea{ min-height: 120px; }

.btn-enviar{
  width:100%;
  margin-top:24px;
  padding:16px;
  border:none;
  border-radius: 30px;
  background: linear-gradient(90deg, var(--azul-medio), var(--azul-brillante));
  color:#fff;
  font-size:16px;
  font-weight:800;
  letter-spacing:0.3px;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(15,107,168,0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.15s ease;
}
.btn-enviar:hover{ box-shadow: 0 8px 20px rgba(15,107,168,0.45); }
.btn-enviar:active{ transform: translateY(1px); }
.btn-enviar:disabled{
  opacity:0.65;
  cursor:not-allowed;
  box-shadow:none;
}

.msg-ok, .msg-error{
  display:none;
  margin-top:16px;
  padding:12px 14px;
  border-radius:12px;
  font-size:14px;
  font-weight:600;
  text-align:center;
}
.msg-ok{
  background:#e8f7ec;
  border:1.5px solid #bfe6c9;
  color:#1e7a37;
}
.msg-error{
  background:#fdeceb;
  border:1.5px solid #f3c1bd;
  color:#b3261e;
}
.msg-ok.show, .msg-error.show{ display:block; }

/* ===== ACORDEÓN REGISTRO ===== */
.registro-card{
  background:#fff;
  margin: 0 18px 26px;
  border-radius: 16px;
  border: 1px solid #e7e9ee;
  box-shadow: 0 6px 18px rgba(20,40,55,0.06);
  overflow:hidden;
}
.registro-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 18px 20px;
  cursor:pointer;
  font-weight:700;
  color: var(--azul-texto);
  font-size:15.5px;
}
.registro-header .chevron{
  transition: transform 0.2s ease;
  color:#8a8a8a;
}
.registro-header.open .chevron{ transform: rotate(180deg); }

.registro-body{
  max-height:0;
  overflow:hidden;
  transition: max-height 0.25s ease;
  padding: 0 20px;
}
.registro-body.open{
  max-height: 600px;
  padding: 0 20px 20px;
  overflow-y:auto;
}

.registro-pass{
  display:flex;
  gap:8px;
  margin-bottom:14px;
}
.registro-pass input{
  flex:1;
}
.registro-pass button{
  background: var(--azul-medio);
  color:#fff;
  border:none;
  border-radius:10px;
  padding: 0 16px;
  font-weight:700;
  cursor:pointer;
}

.registro-item{
  border:1px solid #edeef1;
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:10px;
  font-size:13.5px;
  background:#fafbfc;
}
.registro-item .meta{
  display:flex;
  justify-content:space-between;
  color:#8b8b8b;
  font-size:12px;
  margin-bottom:6px;
}
.registro-item .cat-tag{
  display:inline-block;
  font-weight:700;
  color: var(--azul-texto);
}
.registro-vacio{
  text-align:center;
  color:#9a9a9a;
  font-size:13.5px;
  padding: 10px 0 4px;
}
.registro-item button.del{
  float:right;
  background:none;
  border:none;
  color:#c23b4a;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}

/* ===== FOOTER ===== */
footer{
  text-align:center;
  padding: 10px 30px 40px;
}
footer img{
  width:78px;
  height:78px;
  border-radius:50%;
  margin-bottom:14px;
}
footer p{
  color:#9099a3;
  font-size:12.5px;
  letter-spacing:0.4px;
  line-height:1.5;
  text-transform:uppercase;
  margin:0;
}

/* =========================================================
   RESPONSIVE — TABLET (>=700px) Y ESCRITORIO (>=1024px)
   ========================================================= */

@media (min-width: 700px){
  .page{ max-width: 640px; }

  .top-bar{ padding: 26px 32px; }
  .top-bar .titles h1{ font-size:21px; }

  .hero{ padding: 36px 40px 26px; }
  .hero h2{ font-size:30px; }
  .hero p{ max-width: 460px; }

  .qr-card, .form-card, .registro-card{ margin-left:32px; margin-right:32px; }
}

@media (min-width: 1024px){
  .page{
    max-width: 1180px;
    min-height: 100vh;
  }

  header.top-bar{ padding: 30px 56px; }
  .top-bar .titles h1{ font-size:23px; }
  .top-bar .titles p{ font-size:14.5px; }

  .hero{ padding: 44px 56px 30px; max-width: 760px; margin:0 auto; }
  .hero h2{ font-size:34px; }
  .hero p{ font-size:16px; max-width: 520px; }

  .content-grid{
    display:grid;
    grid-template-columns: 400px 1fr;
    gap: 28px;
    align-items: start;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 56px 10px;
  }

  .content-grid .qr-card{
    margin: 0;
    position: sticky;
    top: 24px;
  }
  .content-grid .form-card{
    margin: 0;
  }

  .categorias{
    grid-template-columns: repeat(4, 1fr);
  }
  .cat-btn{ padding: 20px 8px; }

  .registro-card{
    max-width: 1080px;
    margin: 24px auto 40px;
  }

  footer{ padding: 20px 30px 50px; }
}

@media (min-width: 1440px){
  .page{ max-width: 1280px; }
  .content-grid{ max-width: 1160px; }
  .registro-card{ max-width: 1160px; }
}
