/* ============================================================
   VALIDADOR Y GENERADOR DE IBAN Y BIC - FIJATE TOOLS
   Diseño canónico corporativo, accesible, responsivo y fluido
   ============================================================ */

:root {
  color-scheme: dark;
  --bg-body: #0c0f17;
  --bg-surface: #141824;
  --bg-card: rgba(26, 32, 48, 0.75);
  --bg-card-hover: rgba(32, 40, 60, 0.9);
  --bg-input: #101420;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #ff8507;
  --primary: #ff8507;
  --primary-hover: #ff9924;
  --primary-light: rgba(255, 133, 7, 0.15);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 8px 30px rgba(255, 133, 7, 0.18);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #ff8507;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 8px 30px rgba(255, 133, 7, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

select, .form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-color: var(--bg-input);
  color: var(--text-main);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ff8507' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 40px;
}

select option, select optgroup {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

/* Layout principal */
.tool-layout {
  max-width: 1240px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1rem;
  width: 100%;
  flex: 1;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
}

/* Hero introductorio */
.tool-hero {
  margin-bottom: 2rem;
}

.tool-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 133, 7, 0.25);
}

.tool-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.tool-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 820px;
}

/* Selector de pestañas */
.iban-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.75rem;
}

.iban-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.iban-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.iban-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(255, 133, 7, 0.3);
}

/* Rejilla de la aplicación */
.iban-app-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .iban-app-grid {
    grid-template-columns: 1fr;
  }
}

/* Paneles */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-subtle);
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Formularios */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-control-input {
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control-input.mono {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.form-control-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Cuadrícula de 4 bloques CCC */
.ccc-blocks-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr 2fr;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .ccc-blocks-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Banner de IBAN generado */
.iban-display-banner {
  background: linear-gradient(135deg, rgba(255, 133, 7, 0.15) 0%, rgba(255, 133, 7, 0.04) 100%);
  border: 1px solid rgba(255, 133, 7, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.iban-display-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.iban-display-code {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  letter-spacing: 0.08em;
  word-break: break-all;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.iban-display-sub {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* Rejilla de métricas bancarias */
.bank-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.bank-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.bank-info-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.bank-info-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.bank-info-val.mono {
  font-family: var(--font-mono);
}

/* Banner de validación */
.validation-status-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.validation-status-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.validation-status-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Botones de acción */
.panel-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-act-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 42px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-act-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-act-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 42px;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-act-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

/* Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast */
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.show {
  transform: translateY(0);
  opacity: 1;
}
