/* components.css — buttons, glass cards, forms, generator, copy rows, flash */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.72rem 1.3rem; border-radius: 5px; border: 1px solid var(--border);
    background: transparent; color: var(--text); font-weight: 600; font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
    will-change: transform;
}
.btn:hover { transform: translateY(-2px); color: var(--text); background: var(--surface-2); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 0.9rem 1.7rem; font-size: 1.02rem; }
.btn-primary, .btn-ghost { background: transparent; }

.glass {
    background: linear-gradient(180deg, #eef1f5, #dfe4ec);
    border: 1px solid rgba(15, 23, 36, 0.10); border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: #1b2430;
    /* Local light theme: inner components use these tokens, so they invert to
       dark-on-white automatically (text, inputs, chips, borders, code). */
    --text: #1b2430;
    --muted: #5d6b7d;
    --surface: #f1f4f8;
    --surface-2: #e6ebf2;
    --border: rgba(20, 28, 40, 0.12);
    --primary-2: #c9770a;
}
/* Keep the primary CTA filled-orange and prominent on the white card. */
.glass .btn-primary {
    background: var(--primary); border-color: var(--primary); color: #1b1206;
}
.glass .btn-primary:hover { background: #ffaa3d; color: #1b1206; }

/* Generator */
.generator { padding: 1rem 0 2rem; margin-top: -2rem; }
.gen-card { padding: 2rem; max-width: 760px; margin-inline: auto; }
.gen-head h2 { font-size: 1.5rem; }
.gen-head p { color: var(--muted); }
.gen-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.2rem 0; }
.gen-type {
    display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: all 0.2s ease;
}
.gen-type:hover { border-color: rgba(247, 147, 26, 0.4); color: var(--text); }
.gen-type.is-active { border-color: var(--primary); color: var(--text); background: rgba(247, 147, 26, 0.10); }
.gt-label { font-weight: 700; }
.gt-example { font-family: var(--mono); font-size: 0.78rem; }

.gen-input-wrap {
    display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.2s ease;
}
.gen-input-wrap:focus-within { border-color: var(--primary); }
.gen-marker { padding: 0 0.4rem 0 1rem; font-family: var(--mono); color: var(--primary-2); font-weight: 600; }
.gen-form input[type=text] {
    flex: 1; padding: 0.95rem 1rem 0.95rem 0.2rem; background: transparent; border: 0; color: var(--text);
    font-family: var(--mono); font-size: 1.1rem; letter-spacing: 0.02em;
}
/* Required email field — no leading marker, so it pads from the edge and uses
   the body font (emails read better in sans than mono). */
.gen-email-wrap { margin-top: 0.8rem; }
.gen-form input[type=email] {
    flex: 1; padding: 0.9rem 1rem; background: transparent; border: 0; color: var(--text);
    font-family: var(--font); font-size: 1rem;
}
.gen-form input::placeholder { color: var(--muted); opacity: 0.8; }
.gen-form input:focus { outline: none; }

.gen-estimate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 0.4rem 0 1.2rem; }
.est-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }
.est-item span { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.est-item strong { font-family: var(--mono); font-size: 1.05rem; }
.est-tier strong { color: var(--primary-2); }

.gen-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
/* Primary submit ("Generate free") spans the full width of the actions row */
#gen-submit { flex: 1 1 100%; justify-content: center; }
.gen-progress { margin-top: 1.4rem; }
.gen-scan {
    display: block; margin-bottom: 0.8rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border);
    font-size: 1.02rem; letter-spacing: 0.02em; word-break: break-all; line-height: 1.4;
}
.gen-scan .sc-marker { color: var(--muted); }
.gen-scan .sc-hit { color: var(--bg); font-weight: 800; background: var(--primary); padding: 0.05em 0.2em; border-radius: 6px; }
.gen-scan .sc-scram { color: var(--accent-2); opacity: 0.8; }
.progress-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; border: 1px solid var(--border); }
#progress-fill { display: block; height: 100%; width: 0%; background: var(--grad-cool); transition: width 0.3s ease; }
.progress-bar.is-live::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-meta { display: flex; justify-content: space-between; margin-top: 0.5rem; color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }

.gen-result { display: flex; gap: 1.4rem; margin-top: 1.6rem; padding-top: 1.6rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.result-qr { width: 150px; height: 150px; background: #fff; border-radius: var(--radius-sm); padding: 8px; display: grid; place-items: center; }
.result-qr canvas, .result-qr img { width: 100%; height: 100%; }
.result-fields { flex: 1; min-width: 260px; }
.result-fields label { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.9rem; }
.copy-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
/* Values (addresses/keys) must show their true case — never inherit the
   uppercase from the wrapping <label>. Bitcoin base58 is case-sensitive. */
.copy-row code { flex: 1; min-width: 0; word-break: break-all; overflow-wrap: anywhere; padding: 0.5rem 0.7rem; color: var(--text); font-size: 0.86rem; text-transform: none; }
.copy-row code.is-secret { color: var(--primary-2); }
.btn-copy { width: 38px; height: 38px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.btn-copy.copied { border-color: var(--good); color: var(--good); }
.result-warning { color: var(--primary-2); font-size: 0.82rem; background: rgba(247, 147, 26, 0.08); border: 1px solid rgba(247, 147, 26, 0.22); padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); }

.gen-error { margin-top: 1.2rem; color: var(--bad); background: rgba(255, 93, 108, 0.08); border: 1px solid rgba(255, 93, 108, 0.25); padding: 0.8rem 1rem; border-radius: var(--radius-sm); }

/* Advisory note (non-blocking) — e.g. slow legacy first character. */
.gen-notice { margin-top: 0.9rem; color: var(--primary-2); font-size: 0.84rem; line-height: 1.45; background: rgba(247, 147, 26, 0.08); border: 1px solid rgba(247, 147, 26, 0.22); padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); }

.flash { padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: rgba(47, 212, 122, 0.1); border: 1px solid rgba(47, 212, 122, 0.3); color: var(--good); }
.flash-error { background: rgba(255, 93, 108, 0.1); border: 1px solid rgba(255, 93, 108, 0.3); color: var(--bad); }

@media (max-width: 560px) {
    .gen-types, .gen-estimate { grid-template-columns: 1fr 1fr; }
    .gen-card { padding: 1.3rem; }
}
