* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #020813;
  color: #ffffff;
}

body {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at top,
      rgba(0, 76, 170, 0.45),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #071b38 0%,
      #020814 55%,
      #000000 100%
    );
}

button,
input {
  font-family: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: stretch;
}

.phone {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;

  margin: 0 auto;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(0, 76, 170, 0.14),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      #00295e 0%,
      #001a3d 34%,
      #000b1c 100%
    );
}

/* =====================================================
   ENCABEZADO CORPORATIVO
   ===================================================== */

.app-header {
  position: relative;

  width: 100%;

  padding: 16px 14px 21px;

  overflow: hidden;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% -20%,
      rgba(41, 126, 255, 0.42),
      transparent 52%
    ),
    linear-gradient(
      135deg,
      #064da8 0%,
      #002b65 42%,
      #001630 75%,
      #000912 100%
    );

  border-bottom:
    1px solid rgba(63, 150, 255, 0.55);
}

.app-header::before {
  content: "";

  position: absolute;
  inset: 0;

  opacity: 0.18;

  pointer-events: none;

  background-image:
    linear-gradient(
      30deg,
      rgba(255,255,255,0.14) 1px,
      transparent 1px
    ),
    linear-gradient(
      150deg,
      rgba(255,255,255,0.08) 1px,
      transparent 1px
    );

  background-size: 22px 22px;
}

.corporate-logo-zone {
  position: relative;
  z-index: 2;

  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 auto;
}

.brand-logo-frame {
  position: relative;
  z-index: 3;

  width: 76%;
  height: 92px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 8px 18px;

  overflow: hidden;

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f8f9fc 54%,
      #e9edf4 100%
    );

  border:
    1px solid rgba(255,255,255,0.92);

  clip-path:
    polygon(
      7% 0,
      93% 0,
      100% 50%,
      93% 100%,
      7% 100%,
      0 50%
    );

  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255,255,255,0.95);
}

.brand-logo {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;
}

.logo-side {
  position: absolute;
  top: 9px;

  width: 22%;
  height: 74px;

  z-index: 1;

  background:
    linear-gradient(
      135deg,
      rgba(46, 132, 255, 0.88),
      rgba(0, 36, 91, 0.92)
    );

  border:
    1px solid rgba(83, 164, 255, 0.82);
}

.logo-side-left {
  left: -5%;

  clip-path:
    polygon(
      0 0,
      100% 0,
      65% 50%,
      100% 100%,
      0 100%
    );
}

.logo-side-right {
  right: -5%;

  clip-path:
    polygon(
      0 0,
      100% 0,
      100% 100%,
      0 100%,
      35% 50%
    );
}

.header-separator {
  position: relative;
  z-index: 3;

  width: calc(100% + 28px);
  height: 1px;

  margin: 14px 0 15px -14px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(73, 158, 255, 0.8),
      rgba(73, 158, 255, 0.8),
      transparent
    );
}

.title-row {
  position: relative;
  z-index: 3;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 12px;
}

.title {
  color: #ffffff;

  font-size: clamp(15px, 4vw, 20px);
  font-weight: 900;

  line-height: 1.2;
  letter-spacing: 0.35px;

  white-space: nowrap;
}

.title-side-line {
  flex: 1;
  max-width: 72px;
  height: 3px;

  border-radius: 999px;

  background:
    linear-gradient(
      90deg,
      transparent,
      #f0441f
    );
}

.title-side-line:last-child {
  transform: scaleX(-1);
}

.accent-line {
  position: relative;
  z-index: 3;

  width: 58px;
  height: 4px;

  margin: 13px auto 0;

  border-radius: 999px;

  background: #f0441f;

  box-shadow:
    0 0 16px rgba(240, 68, 31, 0.7);
}

/* =====================================================
   FORMULARIO
   ===================================================== */

.form-area {
  padding: 20px 18px 26px;
}

label {
  display: block;

  margin: 20px 0 9px;

  color: #ffffff;

  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 900;

  letter-spacing: -0.15px;
}

.input-card {
  min-height: 66px;

  display: flex;
  align-items: center;

  gap: 12px;

  padding: 0 16px;

  border-radius: 14px;

  background:
    linear-gradient(
      180deg,
      rgba(7, 29, 58, 0.98),
      rgba(3, 15, 31, 0.98)
    );

  border:
    1px solid rgba(74, 150, 237, 0.48);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 28px rgba(0,0,0,0.22);
}

.input-icon {
  min-width: 28px;

  color: #ff4b24;

  font-size: 25px;
  font-weight: 900;

  text-align: center;
}

input {
  width: 100%;

  border: none;
  outline: none;

  color: #ffffff;
  background: transparent;

  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 700;

  text-transform: uppercase;
}

input::placeholder {
  color: rgba(186, 207, 235, 0.48);

  font-weight: 500;

  text-transform: none;
}

/* =====================================================
   UBICACIÓN Y ESCÁNER
   ===================================================== */

.scan-row {
  display: flex;
  align-items: stretch;

  gap: 10px;
}

.scan-row .ubicacion-card {
  flex: 1;
  min-width: 0;
}

.scan-row .scan-button {
  width: 35%;
  min-width: 116px;
}

.scan-button {
  min-height: 66px;

  border:
    2px solid #ff4b24;

  border-radius: 14px;

  color: #ffffff;

  background:
    linear-gradient(
      180deg,
      rgba(161, 49, 16, 0.88),
      rgba(89, 21, 4, 0.95)
    );

  font-size: clamp(12px, 3.5vw, 16px);
  font-weight: 900;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 20px rgba(240,68,31,0.2);
}

.scan-icon {
  display: block;

  margin-bottom: 4px;

  color: #ff6c49;

  font-size: clamp(22px, 5vw, 29px);
  line-height: 20px;
}

.scan-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =====================================================
   ÁREA DE FOTOGRAFÍA
   ===================================================== */

.photo-box {
  position: relative;

  width: 100%;
  min-height: clamp(250px, 36vh, 380px);

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 18px;

  border:
    1px dashed rgba(142, 180, 226, 0.68);

  background:
    radial-gradient(
      circle at center,
      rgba(0, 92, 210, 0.18),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      rgba(7, 29, 56, 0.96),
      rgba(2, 11, 24, 0.98)
    );

  box-shadow:
    inset 0 0 35px rgba(0, 65, 145, 0.14);
}

.photo-box::before,
.photo-box::after {
  content: "";

  position: absolute;

  width: 50px;
  height: 50px;

  opacity: 0.95;

  pointer-events: none;
}

.photo-box::before {
  top: 23%;
  left: 29%;

  border-top:
    3px solid #2787ff;

  border-left:
    3px solid #2787ff;
}

.photo-box::after {
  right: 29%;
  bottom: 23%;

  border-right:
    3px solid #2787ff;

  border-bottom:
    3px solid #2787ff;
}

.photo-placeholder {
  position: relative;
  z-index: 1;

  padding: 24px;

  text-align: center;
}

.camera-target {
  width: 122px;
  height: 122px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 auto 12px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(18, 74, 145, 0.22),
      rgba(0, 18, 43, 0.06)
    );

  border:
    1px solid rgba(65, 145, 235, 0.25);
}

.camera {
  font-size: clamp(62px, 18vw, 90px);

  filter:
    drop-shadow(
      0 0 18px rgba(59, 139, 245, 0.42)
    );
}

.photo-placeholder p {
  margin: 8px 0 6px;

  color: #ffffff;

  font-size: clamp(18px, 4.7vw, 24px);
  font-weight: 900;
}

.photo-placeholder small {
  color: rgba(175, 202, 235, 0.85);

  font-size: clamp(13px, 3.5vw, 17px);
}

#preview {
  display: none;

  width: 100%;
  height: 100%;

  max-height: 430px;

  object-fit: cover;
}

/* =====================================================
   BOTONES PRINCIPALES
   ===================================================== */

.photo-button,
.register-button {
  width: 100%;
  min-height: 68px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 12px;

  margin-top: 14px;

  border: none;
  border-radius: 13px;

  color: #ffffff;

  font-size: clamp(19px, 5vw, 25px);
  font-weight: 900;

  letter-spacing: 0.3px;

  text-transform: uppercase;

  cursor: pointer;
}

.photo-button {
  background:
    linear-gradient(
      135deg,
      #f34816 0%,
      #d8320e 48%,
      #b92608 100%
    );

  border:
    1px solid rgba(255, 105, 61, 0.9);

  box-shadow:
    0 14px 30px rgba(240,68,31,0.25),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.register-button {
  background:
    linear-gradient(
      135deg,
      #0754c5 0%,
      #003b98 55%,
      #002363 100%
    );

  border:
    1px solid rgba(48, 124, 255, 0.85);

  box-shadow:
    0 14px 30px rgba(0,63,145,0.28),
    inset 0 1px 0 rgba(255,255,255,0.16);
}

.photo-button:disabled,
.register-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =====================================================
   FECHA Y HORA
   ===================================================== */

.live-summary {
  margin-top: 18px;
  padding: 15px 18px;

  display: flex;
  align-items: center;

  gap: 14px;

  border-radius: 15px;

  background:
    linear-gradient(
      180deg,
      rgba(9, 35, 70, 0.94),
      rgba(4, 18, 39, 0.98)
    );

  border:
    1px solid rgba(73,143,230,0.35);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.date-icon {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 44px;

  border-radius: 50%;

  color: #7cb9ff;

  background:
    rgba(14, 65, 130, 0.52);

  font-size: 30px;
}

.date-content {
  min-width: 0;
}

.live-summary span {
  display: block;

  color: rgba(173, 203, 239, 0.92);

  font-size: 14px;
  font-weight: 800;

  text-transform: uppercase;
}

.live-summary strong {
  display: block;

  margin-top: 5px;

  color: #ffffff;

  font-size: clamp(15px, 4vw, 19px);
  font-weight: 700;

  word-break: break-word;
}

.message {
  min-height: 26px;

  margin: 14px 0 0;

  font-size: 15px;
  font-weight: 900;

  text-align: center;
}

.message.ok {
  color: #26d07c;
}

.message.error {
  color: #ff6044;
}

/* =====================================================
   MODAL DEL ESCÁNER
   ===================================================== */

.scanner-modal {
  position: fixed;
  inset: 0;

  z-index: 9999;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 16px;

  background:
    rgba(0, 0, 0, 0.96);
}

.scanner-box {
  width: 100%;
  max-width: 520px;

  padding: 18px;

  border-radius: 20px;

  background:
    linear-gradient(
      180deg,
      #071b36,
      #020712
    );

  border:
    1px solid rgba(240,68,31,0.8);

  box-shadow:
    0 24px 70px rgba(0,0,0,0.65);

  text-align: center;
}

.scanner-box h2 {
  margin: 0 0 6px;

  color: #ffffff;

  font-size: 24px;
}

.scanner-box p {
  margin: 0 0 14px;

  color: #b9c3d1;
}

#scannerReader {
  width: 100%;
  min-height: 320px;

  overflow: hidden;

  border-radius: 14px;

  border:
    2px solid #f0441f;

  background: #000000;
}

#scannerReader video {
  width: 100% !important;
  height: auto !important;

  border-radius: 12px;
}

#scannerReader__dashboard_section_csr {
  color: #ffffff !important;
}

#scannerReader__dashboard_section_swaplink {
  color: #f0441f !important;
}

.scanner-close {
  width: 100%;
  min-height: 58px;

  margin-top: 14px;

  border: none;
  border-radius: 12px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #f0441f,
      #c92f14
    );

  font-size: 16px;
  font-weight: 900;

  cursor: pointer;
}

/* =====================================================
   TABLET Y PC
   ===================================================== */

@media (min-width: 760px) {
  .app-shell {
    padding: 24px;
    align-items: center;
  }

  .phone {
    min-height: auto;

    border-radius: 34px;

    border:
      1px solid rgba(255,255,255,0.18);

    box-shadow:
      0 24px 70px rgba(0,0,0,0.65),
      0 0 0 8px rgba(255,255,255,0.04);
  }

  .brand-logo-frame {
    width: 72%;
    height: 108px;
  }

  .form-area {
    padding: 24px;
  }
}

/* =====================================================
   CELULARES MEDIANOS
   ===================================================== */

@media (max-width: 520px) {
  .app-header {
    padding:
      14px 12px 19px;
  }

  .brand-logo-frame {
    width: 78%;
    height: 86px;

    padding: 7px 14px;
  }

  .logo-side {
    top: 8px;
    height: 70px;
  }

  .title {
    font-size: 15px;
  }

  .title-row {
    gap: 8px;
  }

  .title-side-line {
    max-width: 52px;
  }
}

/* =====================================================
   CELULARES PEQUEÑOS
   ===================================================== */

@media (max-width: 380px) {
  .form-area {
    padding:
      18px 14px 22px;
  }

  .brand-logo-frame {
    width: 82%;
    height: 76px;

    padding: 6px 11px;
  }

  .logo-side {
    top: 7px;
    height: 62px;
  }

  .title {
    font-size: 13px;
  }

  .title-side-line {
    max-width: 34px;
  }

  .scan-row {
    display: block;
  }

  .scan-row .scan-button {
    width: 100%;
    min-width: 0;

    margin-top: 10px;
  }

  .photo-box {
    min-height: 230px;
  }

  .camera-target {
    width: 106px;
    height: 106px;
  }

  .photo-button,
  .register-button {
    min-height: 62px;
  }
}