/* ============================================================
   SecurFex — Sistema visual
   Marca: teal #0B97A6 · navy #06294A
   Tipografía: Space Grotesk · Plus Jakarta Sans · IBM Plex Mono
   ============================================================ */

:root {
  --teal:        #0B97A6;
  --teal-600:    #0E97A6;
  --teal-bright: #1BB6C9;
  --teal-300:    #7FD6DF;
  --teal-soft:   rgba(11,151,166,.12);

  --navy:        #06294A;
  --navy-700:    #0A3257;
  --ink:         #051D33;
  --ink-900:     #03162A;
  --ink-800:     #071E2E;

  --surface:     #081C2E;
  --surface-2:   #0A2237;
  --surface-3:   #0D2840;

  --line:        rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.13);

  --text:        #E8F1F6;
  --text-muted:  #7FA8C2;
  --text-dim:    #3D6480;

  --on-dark:          #EAF1F5;
  --on-dark-muted:    #93AEC2;
  --on-dark-line:     rgba(255,255,255,.10);

  --radius:    14px;
  --radius-lg: 20px;
  --radius-sm: 9px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.25);
  --shadow-md:   0 8px 28px rgba(0,0,0,.40), 0 2px 8px rgba(0,0,0,.25);
  --shadow-lg:   0 24px 56px rgba(0,0,0,.55);
  --shadow-teal: 0 10px 36px -10px rgba(11,151,166,.55);

  --ease: cubic-bezier(.22,.61,.36,1);

  --font-head: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--teal); color: #fff; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── Header ── */
.header {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--teal) 0%, #086B77 100%);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-teal);
}

.logo h1 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.btn-logout {
  background: rgba(239,68,68,.10);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.25);
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.btn-logout:hover {
  background: rgba(239,68,68,.2);
  color: #fca5a5;
}

/* ── Cards ── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 30px;
}

.card h2 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 22px;
  text-align: center;
  letter-spacing: -0.02em;
}

/* ── Options Grid ── */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.option-card {
  background: var(--surface-3);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  text-align: center;
}

.option-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.option-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.option-card h3 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.option-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Forms ── */
.form {
  max-width: 400px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.form-group input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11,151,166,.18);
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrapper input {
  flex: 1;
  padding-right: 44px !important;
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color .2s;
}

.btn-toggle-password:hover { color: var(--teal); }

.form-group input[type="file"] {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  transition: border-color .2s;
}

.form-group input[type="file"]:hover { border-color: var(--teal); }

/* ── File List ── */
.file-list { margin-top: 12px; }

.file-item {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 9px 13px;
  border-radius: 9px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Buttons ── */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-copy {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-teal);
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-bright);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px rgba(11,151,166,.70);
}

.btn-primary:disabled {
  background: var(--surface-3);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1.5px solid var(--line-strong);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--teal);
  color: var(--teal-300);
  transform: translateY(-2px);
}

.btn-success {
  background: rgba(16,185,129,.12);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.25);
}

.btn-success:hover {
  background: rgba(16,185,129,.22);
  color: #a7f3d0;
}

.btn-danger {
  background: rgba(239,68,68,.10);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.25);
}

.btn-danger:hover {
  background: rgba(239,68,68,.2);
  color: #fca5a5;
}

.btn-copy {
  background: var(--teal);
  color: #fff;
  padding: 9px;
  margin-top: 10px;
}

.btn-copy:hover {
  background: var(--teal-bright);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Alerts ── */
.alert {
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14.5px;
}

.alert-info {
  background: rgba(11,151,166,.10);
  border: 1px solid rgba(11,151,166,.25);
  color: var(--teal-300);
}

.alert-success {
  background: rgba(16,185,129,.10);
  border: 1px solid rgba(16,185,129,.25);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.22);
  color: #fbbf24;
}

.alert h3 {
  margin-bottom: 10px;
  font-size: 15px;
  font-family: var(--font-head);
}

.share-link {
  background: var(--surface);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal-soft);
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal-300);
  margin: 12px 0;
}

.transfer-details div {
  margin: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Status / Spinner ── */
.status-container {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  margin: 24px 0;
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 60px;
  font-family: var(--font-body);
}

@keyframes spin { to { transform: rotate(360deg); } }

.status-text {
  font-weight: 600;
  font-family: var(--font-head);
  color: var(--text);
  margin-bottom: 14px;
  font-size: 17px;
}

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
  margin: 14px 0;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  transition: width 0.3s linear;
  border-radius: 100px;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.info-text {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ── History ── */
.history-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1.5px solid var(--line);
}

.tab-btn {
  background: none;
  border: none;
  padding: 11px 20px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .2s;
}

.tab-btn:hover { color: var(--teal-300); }

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.history-list { max-height: 500px; overflow-y: auto; }

.history-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: background .2s, border-color .2s;
}

.history-item:hover {
  background: var(--surface-3);
  border-color: rgba(11,151,166,.2);
}

.history-icon { font-size: 28px; flex-shrink: 0; }

.history-info { flex: 1; }

.history-info strong {
  display: block;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 14.5px;
}

.history-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 5px 0;
}

.history-meta span {
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
}

.status-completed { background: rgba(16,185,129,.10) !important; color: #6ee7b7 !important; border-color: rgba(16,185,129,.3) !important; }
.status-pending   { background: rgba(245,158,11,.08) !important; color: #fbbf24 !important; border-color: rgba(245,158,11,.25) !important; }
.status-failed    { background: rgba(239,68,68,.10) !important; color: #f87171 !important; border-color: rgba(239,68,68,.25) !important; }

.history-info small {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 48px;
  font-family: var(--font-body);
}

/* ── Incoming ── */
.incoming-list { max-height: 500px; overflow-y: auto; }

.incoming-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 14px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: all .2s;
}

.incoming-item:hover {
  background: var(--surface-3);
  border-color: rgba(11,151,166,.2);
  box-shadow: 0 2px 12px rgba(11,151,166,.08);
}

.incoming-icon { font-size: 26px; flex-shrink: 0; }

.incoming-info {
  flex: 1;
  min-width: 0;        /* permite que el texto recorte antes de romperse */
}

.incoming-info strong {
  display: block;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 5px 0;
}

.incoming-meta span {
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
}

.status-badge { font-weight: 600; font-family: var(--font-mono); }
.status-badge.online  { background: rgba(16,185,129,.10) !important; color: #6ee7b7 !important; border-color: rgba(16,185,129,.3) !important; }
.status-badge.offline { background: rgba(239,68,68,.10) !important; color: #f87171 !important; border-color: rgba(239,68,68,.25) !important; }

.btn-accept {
  flex-shrink: 0;
  padding: 11px 22px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
  box-shadow: var(--shadow-teal);
}

.btn-accept:hover:not(:disabled) {
  background: var(--teal-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -10px rgba(11,151,166,.65);
}

.btn-accept:disabled {
  background: var(--surface-3);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* En pantallas estrechas el botón baja debajo del bloque de info */
@media (max-width: 520px) {
  .incoming-item {
    align-items: flex-start;
  }

  /* el icono y la info ocupan toda la fila */
  .incoming-icon { align-self: center; }

  .incoming-info {
    /* ocupa todo el espacio disponible en su fila */
    flex-basis: calc(100% - 42px);
  }

  .btn-accept {
    /* empuja a una nueva línea y ocupa todo el ancho */
    flex-basis: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px;
  }
}

/* ── Navigation bar (legacy) ── */
.navigation-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.nav-btn {
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--text-muted);
  transition: all .2s;
}

.nav-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--teal-300);
  border-color: var(--teal);
}

.nav-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Integrity indicator ── */
.integrity-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.22);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 13.5px;
  color: #6ee7b7;
}

.integrity-indicator.error {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.22);
  color: #f87171;
}

.integrity-indicator .icon { font-size: 1.1rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-content { flex-direction: column; }
  .options-grid   { grid-template-columns: 1fr; }
  .button-group   { grid-template-columns: 1fr; }
  .card           { padding: 20px 18px; }
  .progress-bar   { height: 10px; }
  .progress-text  { font-size: 12px; }
  .nav-btn        { padding: 10px 14px; font-size: 14px; }
  .container      { padding: 16px; }
}
