/* ============================================================
   QR Generator · style.css
   Integrado en el estilo de alejandrolarracilla.com
   Paleta oscura tech · Rajdhani + Roboto
   ============================================================ */

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

:root {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-input:    #0d1117;
  --border:      #30363d;
  --border-glow: #00c8ff33;
  --ink:         #e6edf3;
  --ink-muted:   #8b949e;
  --ink-faint:   #3d444d;
  --accent:      #00c8ff;
  --accent-dim:  #00c8ff22;
  --accent2:     #0090b8;
  --radius:      6px;
  --radius-lg:   10px;
  --heading:     'Rajdhani', sans-serif;
  --body:        'Roboto', sans-serif;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scanlines overlay ── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,200,255,0.015) 2px,
    rgba(0,200,255,0.015) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ── Header ── */
.header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tag {
  font-family: var(--heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-glow);
  padding: 3px 10px;
  border-radius: 2px;
}

.title {
  font-family: var(--heading);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}

.title em {
  font-style: normal;
  color: var(--accent);
}

.subtitle {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  position: relative;
  overflow: hidden;
}

/* Corner accent */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle at top left, var(--accent-dim), transparent 70%);
  pointer-events: none;
}

@media (max-width: 640px) {
  .card {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 28px;
  }
}

/* ── Form ── */
.form-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.label-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

textarea,
select {
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

textarea::placeholder {
  color: var(--ink-faint);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--border-glow);
}

.char-count {
  font-family: var(--body);
  font-size: 11px;
  color: var(--ink-faint);
  text-align: right;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Color picker */
.color-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.color-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--border-glow);
}

input[type="color"] {
  width: 22px; height: 22px;
  border: none; border-radius: 3px;
  padding: 0; cursor: pointer;
  background: none; flex-shrink: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: 3px;
}

.color-hex {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* ── Generate button ── */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: var(--radius);
  padding: 13px 20px;
  font-family: var(--heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  margin-top: 4px;
}

.btn-generate:hover {
  background: #33d4ff;
  box-shadow: 0 0 24px rgba(0,200,255,0.35);
  transform: translateY(-1px);
}

.btn-generate:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-icon {
  flex-shrink: 0;
  transition: transform 0.5s;
}

.btn-generate.loading .btn-icon {
  animation: spin 0.8s linear infinite;
}

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

.shortcut-hint {
  font-size: 11px;
  color: var(--ink-faint);
  text-align: center;
}

kbd {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--ink-muted);
}

/* ── Output ── */
.output-area {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-placeholder {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s;
}

.placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--ink-faint);
  text-align: center;
}

.placeholder-inner p {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  animation: fadeUp 0.3s ease;
}

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

.qr-canvas-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border), 0 0 32px rgba(0,200,255,0.12);
  display: flex;
}

.qr-canvas-wrap canvas,
.qr-canvas-wrap img {
  display: block;
  max-width: 100%;
}

.qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-action {
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0d1117;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s, transform 0.1s;
}

.btn-action:hover {
  background: #33d4ff;
  box-shadow: 0 0 12px rgba(0,200,255,0.3);
  transform: translateY(-1px);
}

.btn-action.outline {
  background: transparent;
  color: var(--accent);
}

.btn-action.outline:hover {
  background: var(--accent-dim);
  box-shadow: none;
}

.btn-action.copied {
  background: #238636;
  border-color: #238636;
  color: #fff;
}

.qr-preview-text {
  font-size: 11px;
  color: var(--ink-faint);
  text-align: center;
  max-width: 220px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

.hidden { display: none !important; }

/* ── Footer ── */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.footer-dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-family: var(--heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 10px 22px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,200,255,0.2);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
