@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Cormorant+SC:wght@600;700&display=swap');

:root {
  --black:#000;--dark:#0A0A0A;--dark2:#111;--dark3:#1A1A1A;
  --gold:#C9A84C;--gold2:#F0C96E;--cyan:#E4C673;
  --white:#FFF;--muted:#555;--muted2:#888;
  --ff-d:'Cormorant SC', serif;
  --ff-b:'Cormorant Garamond', serif;
  --ok:#4ADE80;--warn:#F5A623;--danger:#F87171;--off-state:#5a5a5a;
  --ease:cubic-bezier(.4,0,.2,1);
}
.ba-page *,.ba-page *::before,.ba-page *::after{box-sizing:border-box;margin:0;padding:0}
/* PÁGINA */
.ba-page{
    background:var(--black);
    color:var(--white);
    font-family:var(--ff-m);
    min-height:100vh;
    overflow-x:hidden
}

/* CANVAS */
#ba-canvas{
    position:fixed;
    inset:0;z-index:0;
    pointer-events:none
}

/* WRAP */
.ba-wrap{
    position:relative;
    z-index:1;
    max-width:960px;
    margin:0 auto;
    padding:8vh 6vw 6vh
}

/* HEADER */
.ba-header{
    margin-bottom:6vh
}
.ba-eyebrow{
    font-family:var(--ff-m);
    font-size:11px;
    letter-spacing:.3em;
    text-transform:uppercase;
    color:var(--cyan);
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:1.2rem;
    opacity:0;
    animation:fsu .7s var(--ease) .2s forwards
}
.ba-eyebrow::before{
    content:'▮';
    animation:blink 1s step-end infinite;
    color:var(--cyan)}
@keyframes blink{50%{opacity:0}}
.ba-title{
    font-family:var(--ff-d);
    font-size:clamp(2.5rem,6vw,5.5rem);
    font-weight:800;
    line-height:.9;
    letter-spacing:-.02em;
    color:var(--white);
    opacity:0;
    animation:fsu .8s var(--ease) .4s forwards
}
.ba-title em{
    font-style:normal;color:var(--gold)
}
.ba-sub{
    font-family:var(--ff-m);
    font-size:.78rem;
    color:var(--muted2);
    margin-top:1.2rem;
    line-height:1.6;
    opacity:0;
    animation:fsu .8s var(--ease) .6s forwards
}
@keyframes fsu{
    from
    {
        opacity:0;
        transform:translateY(20px)
    }to{
        opacity:1;
        transform:none
    }
}

/* FORM */
.ba-form{opacity:0;animation:fsu .8s var(--ease) .8s forwards}

/* FIELDS */

.ba-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #1c1c1c;
  border: 1px solid #1c1c1c;
  margin-bottom: 1px;
}

.ba-field {
  background: var(--black);
  padding: 1.6rem 1.8rem 1.2rem;
  position: relative;
  transition: background .3s var(--ease);
}

.ba-field:focus-within {
  background: #0d0d0d;
}

.ba-field__label {
  display: block;
  font-family: var(--ff-m);
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
  transition: color .3s;
}

.ba-field:focus-within .ba-field__label {
  color: var(--cyan);
}

.ba-field__input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--ff-m);
  font-size: .95rem;
  color: var(--white);
  caret-color: var(--cyan);
  padding-bottom: .4rem;
}

.ba-field__input::placeholder {
  color: #b0aeaeb8;
}

.ba-field__line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #1c1c1c;
  overflow: hidden;
}

.ba-field__line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--cyan);
  transition: width .4s var(--ease);
}

.ba-field:focus-within .ba-field__line::after {
  width: 100%;
}

/* NORMAS */

.ba-normas-wrap {
  background: var(--black);
  padding: 1.6rem 1.8rem 1.2rem;
  border-top: 1px solid #edededc5;
}

.ba-normas-label {
  font-family: var(--ff-m);
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 1rem;
  color: #b0aeaeb8;
}

.ba-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ba-chip {
  padding: .3rem .9rem;
  border: 1px solid #2a2a2a;
  font-family: var(--ff-m);
  font-size: .7rem;
  color: var(--muted2);
  background: transparent;
  cursor: pointer;
  transition: all .2s var(--ease);
  user-select: none;
}

.ba-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.ba-chip.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
  font-weight: 500;
}

/* SUBMIT */

.ba-submit-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1px;
}

.ba-btn {
  flex: 1;
  padding: 1.2rem 2rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--ff-d);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color .35s var(--ease);
}

.ba-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-101%);
  transition: transform .35s var(--ease);
}

.ba-btn:hover::before {
  transform: translateX(0);
}

.ba-btn:hover {
  color: var(--black);
}

.ba-btn span {
  position: relative;
  z-index: 1;
}

.ba-btn-reset {
  background: none;
  border: none;
  font-family: var(--ff-m);
  font-size: .72rem;
  letter-spacing: .15em;
  color: var(--muted);
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap;
}

.ba-btn-reset:hover {
  color: var(--white);
}
/* STATUS */

.ba-status {
  font-family: var(--ff-m);
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2rem;
  min-height: 1.2em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ba-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.ba-status--searching .ba-status__dot {
  background: var(--cyan);
  animation: pulse .8s ease-in-out infinite alternate;
}

.ba-status--found .ba-status__dot {
  background: var(--gold);
}

.ba-status--empty .ba-status__dot {
  background: #444;
}

@keyframes pulse {
  from {
    opacity: .3;
    transform: scale(.8);
  }

  to {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* RESULTS */

.ba-results {
  margin-top: 3rem;
}

.ba-results__grid {
  display: grid;
  gap: 1px;
  background: #1c1c1c;  
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));

}

/* CARD */


.ba-card {
  background: var(--black);
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  cursor: default;
  opacity: 0;
  transform: translateY(16px);
  animation: cardIn .45s var(--ease) forwards;
  transition: background .3s;
}


.ba-card:hover {
  background: var(--dark2);
}

.ba-card__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}

.ba-card__initials {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #111;
  border: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-d);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1.2rem;
}

.ba-card__name {
  font-family: var(--ff-d);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .25rem;
}

.ba-card__doc {
  font-family: var(--ff-m);
  font-size: .72rem;
  color: var(--muted2);
  letter-spacing: .1em;
  margin-bottom: 1.2rem;
}

.ba-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ba-card__tag {
  padding: .2rem .6rem;
  border: 1px solid #2a2a2a;
  font-family: var(--ff-m);
  font-size: .65rem;
  color: var(--muted2);
  letter-spacing: .08em;
}

.ba-card__date {
  font-family: var(--ff-m);
  font-size: .65rem;
  color: var(--muted);
  margin-top: 1.2rem;
  letter-spacing: .08em;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* EMPTY */

.ba-empty {
  padding: 4rem 0;
  text-align: center;
}

.ba-empty__code {
  font-family: var(--ff-m);
  font-size: 4rem;
  font-weight: 300;
  color: #1c1c1c;
  display: block;
  margin-bottom: 1rem;
}

.ba-empty__msg {
  font-family: var(--ff-m);
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* RESPONSIVE */

@media (max-width: 680px) {
  .ba-fields {
    grid-template-columns: 1fr;
  }

  .ba-submit-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* SCROLLBAR */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--black);
}

::-webkit-scrollbar-thumb {
  background: #2a2a2a;
}
/* =====================================================
   PDF ROW — Botones de certificado descargable
   ===================================================== */
.ba-card__pdf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid #1c1c1c;
}

.ba-card__pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .7rem;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  font-family: var(--ff-m);
  font-size: .68rem;
  letter-spacing: .05em;
  color: var(--muted2);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: all .2s var(--ease);
}

.ba-card__pdf-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.ba-card__pdf-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 229, 255, .05);
}

.ba-card__pdf-btn--disabled {
  color: #3a3a3a;
  border-color: #1c1c1c;
  cursor: not-allowed;
  opacity: .6;
}

.ba-card__pdf-btn--disabled:hover {
  border-color: #1c1c1c;
  color: #3a3a3a;
  background: transparent;
}
.ba-field__input[type="date"]{
    color: #b0aeaeb8;
}
/* =====================================================
   CERTIFICADOS — Fila por norma con fecha y color de estado
   ===================================================== */
.ba-cert-list{
  display:flex; flex-direction:column; gap:10px;
  margin-top:1.2rem;
}
.ba-cert-row{
  display:flex; align-items:center; gap:10px;
  padding:8px 0;
  border-top:1px solid #1c1c1c;
}
.ba-cert-row:first-child{ border-top:none; padding-top:0; }

.ba-cert-dot{
  width:7px; height:7px; border-radius:50%;
  flex-shrink:0;
}
.ba-cert-dot--pulse{
  animation:pulse .9s ease-in-out infinite alternate;
}

.ba-cert-info{ flex:1; min-width:0; }
.ba-cert-groups{
  display:flex; flex-direction:column; gap:1.4rem;
  margin-top:1.2rem;
}

.ba-cert-group__title{
  font-family:var(--ff-d);
  font-size:.95rem; font-weight:700; letter-spacing:.04em;
  color:var(--gold);
  padding-bottom:.5rem;
  margin-bottom:.6rem;
  border-bottom:1px solid #2a2a2a;
}

.ba-cert-row{
  display:flex; align-items:center; gap:10px;
  padding:6px 0;
}

.ba-cert-fecha{
  flex:1;
  font-family:var(--ff-b);
  font-size:.8rem; color:var(--muted2);
}
.ba-cert-fecha{
  font-family:var(--ff-b);
  font-size:.75rem; color:var(--muted2);
  display:block; margin-top:1px;
}

.ba-card__pdf-btn{
  display:inline-flex; align-items:center; gap:5px;
  padding:.3rem .6rem;
  border:1px solid #2a2a2a;
  border-radius:3px;
  font-family:var(--ff-d);
  font-size:.7rem; font-weight:700; letter-spacing:.04em;
  text-decoration:none;
  background:transparent;
  cursor:pointer;
  flex-shrink:0;
  transition:all .2s var(--ease);
}
.ba-card__pdf-btn svg{ width:15px; height:15px; flex-shrink:0; stroke:currentColor; fill:none; stroke-width:1.6; }
.ba-card__pdf-btn--disabled{
  color:#3a3a3a !important; border-color:#1c1c1c !important;
  cursor:not-allowed; opacity:.6;
}

@media (max-width:480px){
  .ba-cert-row{ flex-wrap:wrap; }
  .ba-card__pdf-btn{ margin-left:17px; }
}
.ba-content-layout {
  display: flex;
  align-items: stretch;   /* antes: flex-start */
  gap: 0;                  /* antes: 24px — ahora se tocan, como un solo bloque */
  border: 1px solid rgba(201,168,76,.18);
  border-radius: 10px;
  overflow: hidden;
  background: #0f0e0c;
  min-height: 560px;
}

.ba-content-layout__main {
  flex: 1;
  min-width: 0;
  padding: 4px;
}

.ba-results__grid {
  display: grid;
  gap: 1px;
  background: #1c1c1c;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Panel de preview — siempre visible, parte fija del layout */
.ba-content-layout__preview {
  flex: 0 0 420px;
  width: 420px;
  border-left: 1px solid rgba(201,168,76,.18);  /* la única "línea divisoria" */
  background: #14120f;
  display: flex;
  flex-direction: column;
  /* quitamos: border, border-radius, box-shadow, position:sticky */
}

.ba-pdf-preview__header {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(201,168,76,.15);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ok, #c9a84c);
  text-transform: uppercase;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ba-pdf-preview__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 6px;
  color: var(--ok, #c9a84c);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.ba-pdf-preview__close:hover {
  background: rgba(201,168,76,.12);
  border-color: rgba(201,168,76,.4);
}

.ba-pdf-preview__body {
  flex: 1;
  position: relative;
  background: #1c1a16;
}

#ba-pdf-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

.ba-pdf-preview__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: rgba(255,255,255,.35);
  font-size: 13px;
  line-height: 1.5;
}

.ba-card__pdf-btn--preview {
  cursor: zoom-in;
}

/* En mobile, se apilan verticalmente en vez de dos columnas */
@media (max-width: 900px) {
  .ba-content-layout {
    flex-direction: column;
  }
  .ba-content-layout__preview {
    position: relative;
    top: 0;
    width: 100%;
    flex: none;
    height: 420px;
  }
}
