@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0e1a;
  --bg2: #111827;
  --bg3: #1a2236;
  --border: #1e2d4a;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 10px;
  --glow: 0 0 20px rgba(56,189,248,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 5px rgba(56,189,248,0.2); } 50% { box-shadow: 0 0 20px rgba(56,189,248,0.4); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.5s ease-out;
  backdrop-filter: blur(10px);
}

nav .logo { font-weight: 700; font-size: 16px; color: var(--accent); letter-spacing: -0.5px; animation: glow 3s ease-in-out infinite; padding: 4px 8px; border-radius: 6px; }
nav .nav-links { display: flex; gap: 6px; align-items: center; }
nav .nav-links a { color: var(--text2); text-decoration: none; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 6px; transition: all 0.3s; cursor: pointer; position: relative; overflow: hidden; }
nav .nav-links a::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: var(--accent); transition: all 0.3s; transform: translateX(-50%); }
nav .nav-links a:hover::after, nav .nav-links a.active::after { width: 70%; }
nav .nav-links a:hover, nav .nav-links a.active { background: var(--bg3); color: var(--text); }

.btn-logout { background: transparent; color: var(--red) !important; border: 1px solid rgba(248,113,113,0.3); font-size: 12px !important; padding: 6px 12px !important; cursor: pointer; border-radius: 6px; font-family: 'Inter', sans-serif; transition: all 0.3s; }
.btn-logout:hover { background: var(--red); color: white !important; transform: scale(1.05); }

.auth-page { min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.6s; }

.auth-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 25px 60px rgba(0,0,0,0.4); animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1); transition: border-color 0.5s; }
.auth-card:hover { border-color: rgba(56,189,248,0.3); }
.auth-card h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-card .subtitle { color: var(--text2); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 16px; animation: slideUp 0.5s ease-out backwards; }
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }

.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 11px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: 'Inter', sans-serif; transition: all 0.3s; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,0.1), var(--glow); transform: translateY(-1px); }
.form-group textarea { resize: vertical; min-height: 100px; }

.btn-primary { width: 100%; padding: 12px; background: linear-gradient(135deg, var(--accent), var(--accent2)); background-size: 200% 200%; animation: gradientShift 4s ease infinite; color: #0a0e1a; border: none; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.3s; margin-top: 8px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(56,189,248,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; animation: pulse 1.5s infinite; }
.btn-success { background: linear-gradient(135deg, var(--green), #059669); }

.auth-link { text-align: center; margin-top: 20px; color: var(--text2); font-size: 13px; }
.auth-link a { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.auth-link a:hover { text-shadow: 0 0 10px rgba(56,189,248,0.5); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; font-weight: 500; animation: shake 0.4s ease-out; }
.alert-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--red); }
.alert-success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: var(--green); animation: slideDown 0.4s ease-out; }

.page-content { max-width: 900px; margin: 0 auto; padding: 30px 20px; animation: fadeIn 0.5s; }
.page-content h1 { font-size: 22px; font-weight: 700; margin-bottom: 24px; animation: slideLeft 0.5s ease-out; }

.controls { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; animation: slideUp 0.4s ease-out; }
.search-input { flex: 1; min-width: 200px; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; font-family: 'Inter', sans-serif; outline: none; transition: all 0.3s; }
.search-input:focus { border-color: var(--accent); box-shadow: var(--glow); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 8px 14px; background: var(--bg2); color: var(--text2); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.3s; }
.filter-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #0a0e1a; border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,189,248,0.3); }

.report-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px; cursor: pointer; transition: all 0.3s; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; animation: slideUp 0.5s ease-out backwards; }
.report-card:nth-child(1) { animation-delay: 0s; }
.report-card:nth-child(2) { animation-delay: 0.05s; }
.report-card:nth-child(3) { animation-delay: 0.1s; }
.report-card:nth-child(4) { animation-delay: 0.15s; }
.report-card:nth-child(5) { animation-delay: 0.2s; }
.report-card:hover { border-color: var(--accent); background: var(--bg3); transform: translateX(6px); box-shadow: var(--glow); }

.report-card .info { flex: 1; min-width: 200px; }
.report-card .info .id { color: var(--accent); font-weight: 700; font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.report-card .info .email { font-size: 14px; margin: 4px 0; }
.report-card .info .phone { font-size: 12px; color: var(--accent2); }
.report-card .info .meta { color: var(--text2); font-size: 12px; }

.status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; transition: all 0.3s; }
.status-pending { background: rgba(251,191,36,0.15); color: var(--yellow); }
.status-in_process { background: rgba(56,189,248,0.15); color: var(--accent); animation: pulse 2s infinite; }
.status-resolved { background: rgba(52,211,153,0.15); color: var(--green); }

.status-select { padding: 6px 10px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.3s; }
.status-select:hover { border-color: var(--accent); }

.responses-badge { background: var(--accent2); color: white; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; animation: float 3s ease-in-out infinite; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); animation: fadeIn 0.6s; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; animation: fadeIn 0.2s; backdrop-filter: blur(4px); }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 550px; max-height: 85vh; overflow-y: auto; animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 17px; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 22px; cursor: pointer; padding: 4px; transition: all 0.3s; border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg3); color: var(--red); transform: rotate(90deg); }
.modal-body { padding: 24px; }

.detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(30,45,74,0.4); font-size: 13px; animation: slideLeft 0.4s ease-out backwards; }
.detail-row:nth-child(1) { animation-delay: 0.05s; }
.detail-row:nth-child(2) { animation-delay: 0.1s; }
.detail-row:nth-child(3) { animation-delay: 0.15s; }
.detail-row:nth-child(4) { animation-delay: 0.2s; }
.detail-row:nth-child(5) { animation-delay: 0.25s; }
.detail-row:nth-child(6) { animation-delay: 0.3s; }
.detail-row:nth-child(7) { animation-delay: 0.35s; }
.detail-row:nth-child(8) { animation-delay: 0.4s; }
.detail-row .label { color: var(--text2); }
.detail-row .value { color: var(--text); font-weight: 500; text-align: right; max-width: 60%; word-break: break-word; }
.detail-row .value.phone { color: var(--accent2); font-family: 'JetBrains Mono', monospace; }

.section-title { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin: 24px 0 12px; animation: slideLeft 0.5s ease-out; }
.response-item { padding: 14px; background: var(--bg); border-radius: 8px; margin-bottom: 8px; border-left: 3px solid var(--accent); font-size: 13px; line-height: 1.6; animation: slideUp 0.4s ease-out backwards; transition: all 0.3s; }
.response-item:hover { border-left-color: var(--accent2); transform: translateX(4px); }
.response-item small { color: var(--text2); font-size: 11px; display: block; margin-top: 6px; }

.char-count { text-align: right; font-size: 11px; color: var(--text2); margin-top: 4px; }
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px; vertical-align: middle; }

@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  nav { padding: 0 12px; }
  nav .nav-links a { padding: 6px 10px; font-size: 12px; }
  .report-card { flex-direction: column; align-items: flex-start; }
  .controls { flex-direction: column; }
}

/* ============================================
   OBSIDIAN — FORMULARIO DE REPORTE
   ============================================ */
.report-page {
  max-width: 640px;
  padding: 24px 16px 60px;
}

.ico {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* Tarjeta obsidian */
.rcard {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(129,140,248,.08), transparent 60%),
    linear-gradient(180deg, #0e0e14, #08080c);
  border: 1px solid #1c1c26;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 40px 120px rgba(0,0,0,.7),
    inset 0 1px 0 rgba(255,255,255,.03);
  animation: slideUp .5s cubic-bezier(.16,1,.3,1);
}

/* Header */
.rcard-head {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 26px 26px 22px;
  border-bottom: 1px solid #17171f;
  background: linear-gradient(180deg, rgba(129,140,248,.05), transparent);
}

.rcard-head-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a78bfa, #7c6ff0);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124,111,240,.4);
}

.rcard-head-icon .ico { width: 24px; height: 24px; }

.rcard-head h1 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.3px;
}

.rcard-head-sub {
  font-size: 13px;
  color: #6b6b7a;
  margin-top: 4px;
}

/* Form */
.rform {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rfield {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfield label {
  font-size: 14.5px;
  font-weight: 700;
  color: #ededf2;
  letter-spacing: .2px;
}

.rfield .req { color: #f472b6; }
.rfield .opt,
.rfield .hint {
  color: #a78bfa;
  font-weight: 500;
  font-size: 13px;
}

.rinput-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rinput-ico {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #4a4a58;
  pointer-events: none;
  z-index: 1;
}

.rform input,
.rform textarea {
  width: 100%;
  padding: 16px 16px 16px 46px;
  border-radius: 14px;
  border: 1px solid #22222e;
  background: #0b0b10;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: .2s ease;
}

.rform textarea {
  padding: 16px;
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

.rform input::placeholder,
.rform textarea::placeholder { color: #45454f; }

.rform input:focus,
.rform textarea:focus {
  border-color: #7c6ff0;
  background: #0d0d15;
  box-shadow: 0 0 0 3px rgba(124,111,240,.18);
}

.rform input[type="date"] { color-scheme: dark; }

.rfield-note {
  font-size: 12px;
  color: #55555f;
  margin-top: -2px;
}

/* Tipo de acceso */
.raccess {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.raccess-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #22222e;
  background: #0b0b10;
  color: #8a8a96;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .2s ease;
}

.raccess-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #3a3a46;
  flex-shrink: 0;
  transition: .2s ease;
}

.raccess-opt.active {
  border-color: #7c6ff0;
  background: rgba(124,111,240,.1);
  color: #fff;
}

.raccess-opt.active .raccess-dot {
  border-color: #a78bfa;
  background: #a78bfa;
  box-shadow: inset 0 0 0 3px #0b0b10;
}

/* Password toggle */
.rpass-toggle {
  position: absolute;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #4a4a58;
  cursor: pointer;
  transition: .2s ease;
}

.rpass-toggle .ico { width: 19px; height: 19px; }
.rpass-toggle:hover { color: #a78bfa; }

/* Char count */
.report-page .char-count {
  text-align: right;
  font-size: 12px;
  color: #55555f;
  margin-top: -2px;
}

/* Upload evidencia */
.rupload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 34px 20px;
  border-radius: 16px;
  border: 2px dashed #2a2a36;
  background: #09090d;
  cursor: pointer;
  text-align: center;
  transition: .2s ease;
}

.rupload:hover {
  border-color: #7c6ff0;
  background: rgba(124,111,240,.04);
}

.rupload-ico { width: 32px; height: 32px; color: #4a4a58; }
.rupload-main { font-size: 14px; color: #6b6b7a; }
.rupload-sub { font-size: 12px; color: #45454f; }

.rupload-preview { margin-top: 12px; }
.rupload-preview img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #22222e;
}

/* Submit */
.rsubmit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 17px;
  margin-top: 4px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(135deg, #a78bfa, #7c6ff0);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: .25s ease;
  box-shadow: 0 10px 30px rgba(124,111,240,.4);
}

.rsubmit .ico { width: 19px; height: 19px; }

.rsubmit:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 14px 38px rgba(124,111,240,.5);
}

.rsubmit:active { transform: translateY(0); }
.rsubmit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 600px) {
  .report-page { padding: 16px 12px 40px; }
  .rcard { border-radius: 20px; }
  .rcard-head { padding: 22px 20px 20px; }
  .rcard-head h1 { font-size: 20px; }
  .rform { padding: 20px; gap: 22px; }
}

@media (max-width: 360px) {
  .raccess { grid-template-columns: 1fr; }
}
