:root{
  --bg:#f6f6f7;
  --fg:#222;
  --muted:#777;
  --blue:#1976d2;
  --green:#2e7d32;
  --amber:#ef6c00;
  --red:#c62828;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font:16px/1.45 system-ui;
}

.wrap{
  max-width:1100px;
  margin:30px auto;
  padding:0 16px;
}

.wrap.small{max-width:420px}

h1,h2{margin:8px 0 12px}

label{display:block;margin:10px 0}

/* ============================
   INPUTS GENERALES
   ============================ */
input,select,textarea{
  width:100%;
  padding:10px;
  border:1px solid #ccc;
  border-radius:8px;
  background:#fff;
}

textarea{min-height:160px}

/* ============================
   BOTONES GENERALES
   ============================ */
button,.btn{
  background:#111;
  color:#fff;
  border:none;
  padding:10px 14px;
  border-radius:8px;
  text-decoration:none;
  cursor:pointer;
}

.btn.blue{background:var(--blue)}

.btn{margin-left:0}
.panel-head .btn{margin-left:8px}

/* ============================
   TABLAS
   ============================ */
.table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
}

.table th,.table td{
  padding:12px;
  border-bottom:1px solid #eee;
}

/* ============================
   HEADER PANEL
   ============================ */
.panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}

/* ============================
   FILTROS (BASE)
   ============================ */
.filters{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
  margin:12px 0;
}

/* ============================
   BADGES
   ============================ */
.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  color:#fff;
}

.badge.no-procesado{background:var(--muted)}
.badge.en-revisión{background:var(--blue)}
.badge.revisado{background:var(--green)}
.badge.finalizado{background:#222}
.badge.no-procede{background:var(--red)}

/* ============================
   PAGINACIÓN
   ============================ */
.pager{margin:14px 0}

.page{
  display:inline-block;
  padding:6px 10px;
  border:1px solid #ddd;
  margin-right:4px;
  border-radius:8px;
  background:#fff;
  text-decoration:none;
  color:#333;
}

.page.active{
  background:#111;
  color:#fff;
  border-color:#111;
}

.hidden{display:none !important}

.alert{
  background:#ffe6e6;
  color:#a00;
  padding:10px;
  border-radius:8px;
}

/* ============================
   LOGIN
   ============================ */
.login-container{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#1e3c72,#2a5298);
  padding:20px;
}

.login-box{
  background:#fff;
  color:#333;
  width:100%;
  max-width:380px;
  padding:40px 32px;
  border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.25);
  animation:fadeIn .45s ease;
}

.login-box h1{
  font-size:22px;
  text-align:center;
  margin-bottom:24px;
  font-weight:600;
  color:#1e3c72;
}

.login-box input{
  padding:10px 12px;
  margin-bottom:14px;
  font-size:14px;
}

.login-box button[type="submit"]{
  width:100%;
  padding:11px;
  background:#1e3c72;
  color:#fff;
  border:none;
  border-radius:8px;
  font-weight:600;
  font-size:15px;
  cursor:pointer;
  transition:0.25s;
}

.login-box button[type="submit"]:hover{
  background:#264b8a;
}

/* ============================
   PANEL RESPONSIVE
   ============================ */
.panel-page .filters{
  display:grid;
  grid-template-columns:repeat(7,minmax(140px,1fr));
  gap:12px;
  align-items:end;
}

.panel-page .filters input,
.panel-page .filters select{
  height:46px;
  padding:10px 12px;
  font-size:15px;
}

/* Botones filtros - IGUALES (button y link) */
.panel-page .filters button.btn,
.panel-page .filters a.btn{
  height:46px !important;
  min-width:100px !important;
  padding:0 20px !important;
  margin:0 !important;
  font-size:15px !important;
  font-weight:600 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  line-height:1 !important;
  box-sizing:border-box !important;
  vertical-align:middle !important;
  border-radius:8px !important;
  background:#111 !important;
  color:#fff !important;
  border:none !important;
  text-decoration:none !important;
  cursor:pointer !important;
}

/* Tablet */
@media (max-width:900px){
  .panel-page .filters{
    grid-template-columns:repeat(2,1fr);
  }
  .panel-page .filters .btn{
    width:100%;
  }
}

/* Móvil */
@media (max-width:480px){
  .panel-page .filters{
    grid-template-columns:1fr;
    gap:10px;
  }
  .panel-page .filters .btn{
    margin-top:6px;
    height:48px;
    font-size:16px;
    border-radius:12px;
  }
}

/* ============================
   HEADER PANEL MÓVIL
   ============================ */
@media (max-width:700px){
  .panel-page .panel-head{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }

  .panel-page .panel-head h1{
    font-size:26px;
    line-height:1.2;
  }

  .panel-page .panel-head > div{
    display:flex;
    align-items:center;
    gap:12px;
    width:100%;
  }

  .panel-page .panel-head small{
    flex:1;
    white-space:normal;
  }

  .panel-page .panel-head .btn{
    flex-shrink:0;
  }
}

/* ============================
   TABLA -> TARJETAS EN MÓVIL
   ============================ */
@media (max-width:700px){
  .panel-page .table thead{display:none}

  .panel-page .table,
  .panel-page .table tbody,
  .panel-page .table tr,
  .panel-page .table td{
    display:block;
    width:100%;
  }

  .panel-page .table tr{
    background:#fff;
    border-radius:12px;
    padding:10px 12px;
    margin-bottom:12px;
    box-shadow:0 2px 10px rgba(0,0,0,.06);
  }

  .panel-page .table td{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:8px 0;
    border-bottom:1px solid #eee;
  }

  .panel-page .table td:last-child{border-bottom:0}

  .panel-page .table td::before{
    content:attr(data-label);
    font-weight:600;
    opacity:.75;
  }

  .panel-page .table td.acciones{
    justify-content:flex-end;
  }

  .panel-page .table td.acciones::before{
    content:"";
  }
}

/* ============================
   FECHAS (Safari / iOS)
   ============================ */
.panel-page .filters input[type="date"]{
  height:46px;
  padding:10px 12px;
  line-height:1.2;
  font-size:15px;
  -webkit-appearance:none;
  appearance:none;
}

.panel-page .filters input[type="date"]::-webkit-date-and-time-value{
  height:46px;
  line-height:46px;
}

.panel-page .filters input[type="date"]::-webkit-inner-spin-button{
  display:none;
}

.panel-page .filters input[type="date"]::-webkit-calendar-picker-indicator{
  opacity:.7;
  cursor:pointer;
}

/* ============================
   ANIMACIONES
   ============================ */
@keyframes fadeIn{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:translateY(0)}
}


.login-box .pw-wrap{
  position: relative !important;
  display: block !important;
  width: 100% !important;
  margin-bottom: 14px !important;
}

.login-box .pw-wrap input{
  width: 100% !important;
  display: block !important;
  margin-bottom: 0 !important;
  padding-right: 60px !important;
}


.login-box .pw-wrap button.pw-peek{
  all: unset !important;

  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;

  width: 24px !important;
  height: 24px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  color: #666 !important;
  cursor: pointer !important;
  user-select: none !important;
  line-height: 1 !important;
}

.login-box .pw-wrap button.pw-peek:hover{
  color: #1e3c72 !important;
}

/* ============================
   INFO CANAL (página previa)
   ============================ */
.info-page{
  max-width: 1200px;          /* un poco más ancho que el login */
  padding-top: 24px;
  padding-bottom: 40px;
}

.info-card{
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.10);
  padding: 28px 26px;
  border: 1px solid rgba(0,0,0,.06);
}

.info-card h1{
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.info-card p{
  margin: 12px 0;
  color: #2a2a2a;
  font-size: 16px;
  line-height: 1.65;
}

.info-card strong{
  color: #111;
}

.info-card ul{
  margin: 10px 0 14px;
  padding-left: 18px;
}

.info-card li{
  margin: 8px 0;
  line-height: 1.5;
}

.info-card a{
  color: var(--blue);
  text-decoration: none;
}
.info-card a:hover{
  text-decoration: underline;
}

/* Bloque de enlaces a políticas */
.info-card .policies{
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(25,118,210,.06);
  border: 1px solid rgba(25,118,210,.14);
  border-radius: 12px;
}

/* Botonera inferior */
.info-actions{
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.info-cta{
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* Responsive */
@media (max-width: 520px){
  .info-page{
    padding-top: 18px;
  }
  .info-card{
    padding: 22px 18px;
    border-radius: 16px;
  }
  .info-card h1{
    font-size: 28px;
  }
  .info-cta{
    width: 100%;
    text-align: center;
  }
}

/* Texto del botón principal en info-canal */
.info-page .btn.info-cta{
  color: #ffffff; /* cámbialo al color que quieras */
}

/* Hover opcional */
.info-page .btn.info-cta:hover{
  color: #eaf2ff;
}

/* Evitar subrayado en el botón del canal */
.info-card a.info-cta,
.info-card a.info-cta:hover{
  text-decoration: none;
}

/* ============================
   AVISO RGPD - FORMULARIO
   ============================ */
.rgpd-notice{
  margin: 16px 0 14px;
  padding: 12px 14px;

  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;

  font-size: 13px;
  line-height: 1.5;
  color: #555;

  box-shadow: 0 4px 12px rgba(0,0,0,.04);
}

.rgpd-notice p{
  margin: 6px 0;
}

.rgpd-notice strong{
  color: #111;
}

.rgpd-notice a{
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.rgpd-notice a:hover{
  text-decoration: underline;
}

/* ============================
   PÁGINA GRACIAS - TOKEN
   ============================ */
.success-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border: 2px solid #28a745;
}

.exp-label, .token-label {
  font-size: 13px;
  color: #666;
  margin: 0 0 6px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.exp-code, .token-code {
  font-size: 22px;
  font-weight: 700;
  color: #1e3c72;
  margin: 0 0 16px;
  font-family: 'Courier New', monospace;
  background: #f0f4ff;
  padding: 12px;
  border-radius: 8px;
  word-break: break-all;
}

.token-code {
  font-size: 14px;
  color: #c62828;
  background: #fff3e0;
}

.token-info {
  display: block;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-top: 10px;
  padding: 10px;
  background: #fff9e6;
  border-left: 3px solid #ffa000;
  border-radius: 4px;
}

.success-box hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 16px 0;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .actions {
    flex-direction: column;
  }
  .actions .btn {
    width: 100%;
  }
  .exp-code, .token-code {
    font-size: 16px;
  }
}

/* ============================
   PANTALLA INICIAL - SELECCIÓN
   ============================ */
.selection-screen {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.selection-container {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.selection-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #1e3c72;
  letter-spacing: -0.5px;
}

.selection-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0 0 40px;
  line-height: 1.6;
}

.selection-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.selection-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.selection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #1976d2, #42a5f5);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.selection-card:hover::before {
  transform: scaleX(1);
}

.selection-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(25, 118, 210, 0.2);
  border-color: #1976d2;
}

.selection-card.create {
  background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
}

.selection-card.consult {
  background: linear-gradient(135deg, #fff 0%, #fff9f0 100%);
}

.selection-card.consult::before {
  background: linear-gradient(90deg, #ef6c00, #ffa726);
}

.selection-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.selection-card:hover .selection-icon {
  transform: scale(1.15) rotate(5deg);
}

.selection-card-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #222;
}

.selection-card-desc {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.selection-card-arrow {
  margin-top: 20px;
  font-size: 20px;
  color: #1976d2;
  transition: transform 0.3s ease;
}

.selection-card:hover .selection-card-arrow {
  transform: translateX(8px);
}

@media (max-width: 700px) {
  .selection-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .selection-title {
    font-size: 26px;
  }
  
  .selection-card {
    padding: 30px 24px;
  }
  
  .selection-icon {
    font-size: 56px;
  }
}

/* ============================
   FORMULARIO MODERNO
   ============================ */
.form-container {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.form-container.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #e0e0e0;
}

.form-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1e3c72;
}

.form-header p {
  font-size: 15px;
  color: #666;
  margin: 0;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  color: #666;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.back-button:hover {
  background: #e0e0e0;
  color: #333;
  transform: translateX(-4px);
}

/* Progress Indicator */
.form-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.form-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e0e0e0;
  z-index: 0;
}

.form-progress-line {
  position: absolute;
  top: 20px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1976d2, #42a5f5);
  transition: width 0.5s ease;
  z-index: 1;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.progress-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.3s ease;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.progress-step.active .progress-step-circle {
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  transform: scale(1.1);
}

.progress-step.completed .progress-step-circle {
  background: #2e7d32;
  color: #fff;
}

.progress-step-label {
  font-size: 12px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-step.active .progress-step-label {
  color: #1976d2;
}

.progress-step.completed .progress-step-label {
  color: #2e7d32;
}

/* Form Sections */
.form-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.form-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.form-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Enhanced Form Fields */
.form-field {
  margin-bottom: 24px;
  position: relative;
}

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #444;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-field label .required {
  color: #c62828;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #fff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.1);
  transform: translateY(-1px);
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
  font-family: inherit;
}

.form-field small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #777;
}

/* File Upload */
.file-upload-area {
  position: relative;
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  background: #fafafa;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: #1976d2;
  background: #f0f7ff;
}

.file-upload-area.dragover {
  border-color: #1976d2;
  background: #e3f2fd;
  transform: scale(1.02);
}

.file-upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: #1976d2;
}

.file-upload-text {
  font-size: 15px;
  color: #666;
  margin-bottom: 8px;
}

.file-upload-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-list {
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.file-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

.file-item-remove {
  background: #c62828;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.file-item-remove:hover {
  background: #b71c1c;
  transform: scale(1.05);
}

/* Form Navigation */
.form-navigation {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e0e0e0;
}

.btn-prev,
.btn-next,
.btn-submit {
  flex: 1;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-prev {
  background: #f5f5f5;
  color: #666;
}

.btn-prev:hover {
  background: #e0e0e0;
  color: #333;
  transform: translateX(-4px);
}

.btn-next,
.btn-submit {
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-next:hover,
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.btn-submit {
  background: linear-gradient(135deg, #2e7d32, #66bb6a);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-submit:hover {
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

/* Validation */
.form-field.error input,
.form-field.error select,
.form-field.error textarea {
  border-color: #c62828;
}

.form-field.success input,
.form-field.success select,
.form-field.success textarea {
  border-color: #2e7d32;
}

.error-message {
  color: #c62828;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}

.form-field.error .error-message {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Character Counter */
.char-counter {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.char-counter.warning {
  color: #ef6c00;
}

.char-counter.error {
  color: #c62828;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
  .form-progress {
    overflow-x: auto;
    padding-bottom: 10px;
  }
  
  .progress-step-label {
    font-size: 10px;
  }
  
  .progress-step-circle {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .form-navigation {
    flex-direction: column-reverse;
  }
  
  .btn-prev,
  .btn-next,
  .btn-submit {
    width: 100%;
  }
}
