﻿:root {
  --bg-top: #eaf3ff;
  --bg-bottom: #f7fbff;
  --glass: rgba(255, 255, 255, 0.64);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.88);
  --text-main: #1f3144;
  --text-soft: #4a637a;
  --primary: #2e7db9;
  --primary-hover: #236696;
  --secondary: #dceaf6;
  --secondary-hover: #c9deef;
  --warning-bg: rgba(255, 241, 228, 0.86);
  --warning-text: #915322;
  --success-bg: rgba(231, 252, 240, 0.88);
  --success-text: #1f7648;
  --info-bg: rgba(232, 242, 252, 0.88);
  --info-text: #2b5f8e;
  --shadow-soft: 0 20px 44px rgba(25, 55, 89, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background: linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.55;
}

body::before {
  width: 320px;
  height: 320px;
  top: -80px;
  right: -60px;
  background: #d5e9ff;
}

body::after {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: -100px;
  background: #d9f2ee;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(980px, 92vw);
  margin: 28px auto 38px;
  display: grid;
  gap: 14px;
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero {
  padding: 22px 24px;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.input-card {
  padding: 20px;
}

label {
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 250px;
  border: 1px solid rgba(141, 173, 205, 0.55);
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  color: var(--text-main);
  font: inherit;
  line-height: 1.5;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

textarea:focus {
  outline: none;
  border-color: rgba(46, 125, 185, 0.82);
  box-shadow: 0 0 0 4px rgba(46, 125, 185, 0.13);
  transform: translateY(-1px);
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(160deg, #338acc, var(--primary));
  color: #fff;
  box-shadow: 0 8px 20px rgba(46, 125, 185, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(160deg, #2f80bd, var(--primary-hover));
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-main);
  border-color: rgba(138, 168, 197, 0.5);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.95);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text-main);
  border-color: rgba(130, 159, 187, 0.52);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn.is-copied {
  background: #d4f2df;
  border-color: rgba(88, 168, 118, 0.42);
}

.mensaje {
  min-height: 24px;
  margin: 0;
  padding: 0 6px;
  color: var(--text-soft);
  font-size: 0.96rem;
}

.mensaje:not(:empty) {
  border-radius: 10px;
  padding: 9px 12px;
}

.mensaje[data-tipo="warning"] {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.mensaje[data-tipo="success"] {
  background: var(--success-bg);
  color: var(--success-text);
}

.mensaje[data-tipo="info"] {
  background: var(--info-bg);
  color: var(--info-text);
}

.result-card {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.output-block h2 {
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.output-line {
  margin: 0;
  min-height: 86px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(145, 173, 198, 0.4);
  background: rgba(250, 253, 255, 0.86);
  line-height: 1.52;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.copy-row {
  display: flex;
  justify-content: center;
}

.detected-panel {
  padding: 14px 16px;
}

.detected-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.fields-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(248, 252, 255, 0.72);
  border: 1px solid rgba(173, 197, 219, 0.32);
}

.field-label {
  font-weight: 600;
  color: #304c66;
}

.field-value {
  color: #203346;
}

.fields-placeholder {
  margin: 0;
  color: var(--text-soft);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(980px, 94vw);
    margin: 18px auto 26px;
    gap: 12px;
  }

  .hero,
  .input-card,
  .result-card,
  .detected-panel {
    padding: 16px;
  }

  textarea {
    min-height: 220px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
