:root {
    --navy-950: #071126;
    --navy-900: #0b1734;
    --navy-800: #122756;
    --navy-700: #1a3b80;
    --gold-600: #a9790a;
    --gold-500: #c89418;
    --gold-300: #e5c46f;
    --ink: #172033;
    --muted: #667085;
    --line: #dbe1ea;
    --surface: #ffffff;
    --canvas: #f2f5fa;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --success: #067647;
    --success-bg: #ecfdf3;
    --shadow: 0 24px 60px rgba(10, 25, 56, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 13px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.hero {
    color: white;
    background:
        radial-gradient(circle at 88% 10%, rgba(200, 148, 24, 0.32), transparent 24rem),
        linear-gradient(135deg, var(--navy-950), var(--navy-700));
    padding: 42px 24px 96px;
}

.hero-inner {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.eyebrow, .step-label {
    display: block;
    color: var(--gold-300);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.hero h1 {
    margin: 8px 0 8px;
    max-width: 760px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 690px;
    margin: 0;
    color: rgba(255,255,255,0.82);
    font-size: 1.05rem;
}

.security-seal {
    min-width: 210px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    background: rgba(255,255,255,0.09);
    backdrop-filter: blur(10px);
}

.seal-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-500);
    color: white;
    font-weight: 900;
}

.security-seal strong, .security-seal small { display: block; }
.security-seal small { color: rgba(255,255,255,0.68); }

.page-shell {
    width: min(1228px, calc(100% - 32px));
    margin: -58px auto 48px;
}

.app-card {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-panel, .preview-panel { padding: 34px; }
.preview-panel { background: #f8fafc; border-left: 1px solid var(--line); }

fieldset { border: 0; margin: 0; padding: 0; }
legend { margin-bottom: 14px; font-size: 1.05rem; font-weight: 800; }

.model-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.model-card {
    position: relative;
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.model-card:hover { transform: translateY(-2px); border-color: #aab7cb; }
.model-card.is-selected {
    border-color: var(--gold-500);
    background: #fffaf0;
    box-shadow: 0 0 0 3px rgba(200, 148, 24, 0.13);
}
.model-card input { position: absolute; opacity: 0; pointer-events: none; }
.model-icon { font-size: 1.5rem; }
.model-copy { min-width: 0; }
.model-copy strong, .model-copy small { display: block; }
.model-copy strong { font-size: 0.94rem; }
.model-copy small { margin-top: 2px; color: var(--muted); font-size: 0.76rem; }
.model-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    display: none;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-500);
    color: white;
    font-size: 0.68rem;
    font-weight: 900;
}
.model-card.is-selected .model-check { display: grid; }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dynamic-fields {
    margin-top: 20px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.model-fields { display: none; }
.model-fields.is-active { display: block; animation: reveal .2s ease; }

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

.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 7px; font-weight: 750; font-size: 0.92rem; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.78rem; }

input, select, textarea {
    width: 100%;
    border: 1px solid #cfd7e4;
    border-radius: 12px;
    outline: none;
    background: white;
    color: var(--ink);
    padding: 12px 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(200, 148, 24, 0.13);
}
input:disabled, select:disabled, textarea:disabled { opacity: 0.65; cursor: not-allowed; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 86px; }
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: #eef2f7;
    color: var(--navy-800);
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 650;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--gold-500); }

.form-actions, .preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 24px;
}

.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(0.98); }
.btn:focus-visible { outline: 3px solid rgba(200,148,24,.28); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: white; box-shadow: 0 10px 20px rgba(169,121,10,.18); }
.btn-secondary { background: #e9eef6; color: var(--navy-800); }
.btn:disabled { opacity: .66; cursor: wait; transform: none; }
.btn-loading { display: none; }
.btn.is-loading .btn-text { display: none; }
.btn.is-loading .btn-loading { display: inline; }

.privacy-note, .scan-tip {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.79rem;
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 12px;
}
.alert ul { margin: 7px 0 0; padding-left: 20px; }
.alert-error { border-color: #f7b9b4; background: var(--danger-bg); color: var(--danger); }
.alert-success { border-color: #a6e7c5; background: var(--success-bg); color: var(--success); }

.preview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.preview-heading h2 { margin: 5px 0 0; font-size: 1.65rem; letter-spacing: -0.03em; }
.step-label { color: var(--gold-600); }

.status-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: #e8edf5;
    color: #607087;
    font-size: 0.74rem;
    font-weight: 800;
}
.status-pill.is-ready { background: var(--success-bg); color: var(--success); }

.preview-empty {
    min-height: 420px;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 32px;
    border: 1px dashed #bbc5d4;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.66);
}
.empty-icon {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 22px;
    background: #e8edf5;
    color: var(--navy-700);
    font-size: 2.6rem;
}
.preview-empty h3 { margin: 0 0 8px; }
.preview-empty p { max-width: 330px; margin: 0 auto; color: var(--muted); }

.qr-presentation {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.qr-image-wrap {
    max-width: 100%;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 14px 30px rgba(0,0,0,.09);
}
.qr-image-wrap img { display: block; width: 100%; height: auto; }
.qr-size-250 { width: 250px; }
.qr-size-350 { width: 350px; }
.qr-size-450 { width: 450px; }
.qr-presentation h3 { margin: 22px 0 5px; }
.qr-presentation p { margin: 0; opacity: .78; }
.result-description {
    max-width: 100%;
    margin-top: 14px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.64);
    font-size: .78rem;
    word-break: break-word;
}

.theme-padrao { background: linear-gradient(160deg, #ffffff, #edf2f8); color: var(--ink); }
.theme-azul { background: linear-gradient(145deg, var(--navy-950), var(--navy-700)); color: white; }
.theme-dourado { background: linear-gradient(145deg, #fff7dd, #ecd493); color: #503900; }
.theme-escuro { background: linear-gradient(145deg, #080b12, #242a35); color: white; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 20;
    transform: translate(-50%, 20px);
    padding: 11px 16px;
    border-radius: 999px;
    background: var(--navy-950);
    color: white;
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .app-card { grid-template-columns: 1fr; }
    .preview-panel { border-left: 0; border-top: 1px solid var(--line); }
    .hero-inner { align-items: flex-start; }
}

@media (max-width: 720px) {
    .hero { padding: 30px 18px 82px; }
    .hero-inner { display: block; }
    .security-seal { margin-top: 22px; width: fit-content; }
    .page-shell { width: min(100% - 20px, 1228px); margin-top: -48px; }
    .form-panel, .preview-panel { padding: 22px; }
    .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 430px) {
    .model-grid { grid-template-columns: 1fr; }
    .form-actions, .preview-actions { display: grid; }
    .btn { width: 100%; }
    .qr-presentation { padding: 20px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Ajustes da edição sem Composer */
[hidden] { display: none !important; }
.qr-image-wrap svg { display: block; width: 100%; height: auto; background: #fff; }
.preview-actions { flex-wrap: wrap; }
.btn:disabled { cursor: not-allowed; opacity: .65; transform: none; }
.security-detail { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
