:root {
    --bg: #f4f9ff;
    --surface: #ffffff;
    --panel: #061321;
    --panel-2: #062653;
    --blue: #006dff;
    --blue-2: #0088ff;
    --sky: #e6f3ff;
    --orange: #ff970f;
    --orange-2: #ffb342;
    --text: #071a33;
    --muted: #6a7f96;
    --line: #cbdff5;
    --white: #ffffff;
    --shadow: 0 22px 60px rgba(6, 19, 33, 0.18);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 80% 8%, rgba(255, 151, 15, 0.18), transparent 28%),
        radial-gradient(circle at 18% 18%, rgba(126, 199, 255, 0.28), transparent 34%),
        var(--bg);
    color: var(--text);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 420px) 1fr;
}

.painel {
    padding: 28px;
    background:
        radial-gradient(circle at 14% 0%, rgba(0, 109, 255, 0.34), transparent 34%),
        linear-gradient(155deg, var(--panel) 0%, var(--panel-2) 68%, #073b80 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--white);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--white);
    text-decoration: none;
    font-size: 19px;
    font-weight: 900;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
}

.app-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.app-nav a,
.app-nav button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid rgba(203, 223, 245, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    font-family: inherit;
    cursor: pointer;
}

.app-nav a:hover,
.app-nav button:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.auth-greeting {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--white);
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.cart-count {
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 7px;
    border-radius: 999px;
    color: var(--panel);
    background: var(--orange);
    font-size: 12px;
    font-weight: 900;
}

.app-nav .nav-button {
    grid-column: span 2;
    border-color: transparent;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--panel);
}

.app-nav .nav-logout {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(203, 223, 245, 0.28);
    color: var(--white);
}

h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 0;
}

.subtitulo {
    margin: 0 0 24px;
    color: #d8e8f7;
    line-height: 1.45;
}

form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

label,
fieldset {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #eef7ff;
}

input[type="text"],
input[type="color"],
input[type="number"] {
    width: 100%;
}

input[type="text"],
input[type="number"] {
    padding: 13px 14px;
    border: 1px solid rgba(203, 223, 245, 0.46);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 15px;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.66);
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: 3px solid rgba(255, 151, 15, 0.22);
    border-color: var(--orange);
}

input[type="color"] {
    height: 46px;
    border: 1px solid rgba(203, 223, 245, 0.46);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--orange);
}

#qr_valor {
    color: var(--orange-2);
    font-weight: 900;
}

.qr-warning {
    margin: -8px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 151, 15, 0.36);
    border-radius: 8px;
    background: rgba(255, 151, 15, 0.12);
    color: #ffd79b;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.linha {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.linha label {
    min-width: 0;
}

.funnel-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 22px;
}

.funnel-steps span {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(203, 223, 245, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #eef7ff;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.template-switch {
    margin: 0;
    padding: 0;
    border: 0;
}

.template-switch legend {
    margin-bottom: 8px;
    color: #eef7ff;
    font-size: 14px;
    font-weight: 900;
}

.template-switch label {
    position: relative;
    cursor: pointer;
}

.template-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-switch label > span {
    min-height: 64px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid rgba(203, 223, 245, 0.36);
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.template-switch input:checked + span {
    border-color: var(--orange);
    background: rgba(255, 151, 15, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 151, 15, 0.13);
}

.template-switch strong {
    color: var(--white);
}

.template-switch small {
    color: #d8e8f7;
    font-weight: 800;
}

.size-options {
    margin: 0;
    padding: 0;
    border: 0;
}

.size-options legend {
    margin-bottom: 8px;
    color: #eef7ff;
    font-size: 14px;
    font-weight: 900;
}

.size-options label {
    position: relative;
    cursor: pointer;
}

.size-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-options label > span {
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid rgba(203, 223, 245, 0.36);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
}

.size-options input:checked + span {
    border-color: var(--orange);
    background: rgba(255, 151, 15, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 151, 15, 0.13);
}

.size-options strong {
    color: var(--white);
}

.size-options small {
    color: #d8e8f7;
    font-weight: 800;
}

.icon-options {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.icon-options legend {
    grid-column: 1 / -1;
    margin-bottom: 0;
    color: #eef7ff;
    font-size: 14px;
    font-weight: 900;
}

.icon-options label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.icon-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.icon-options label > span {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(203, 223, 245, 0.36);
    border-radius: 8px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #eef7ff;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    pointer-events: none;
}

.icon-options input:checked + span {
    border-color: var(--orange);
    background: rgba(255, 151, 15, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 151, 15, 0.13);
}

.platform-options {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.platform-options legend {
    grid-column: 1 / -1;
    margin-bottom: 0;
    color: #eef7ff;
    font-size: 14px;
    font-weight: 900;
}

.platform-options label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.platform-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.platform-options label > span {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(203, 223, 245, 0.36);
    border-radius: 8px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #eef7ff;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    pointer-events: none;
}

.platform-options input:checked + span {
    border-color: var(--orange);
    background: rgba(255, 151, 15, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 151, 15, 0.13);
}

.advanced-options {
    border: 1px solid rgba(203, 223, 245, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
}

.advanced-options summary {
    padding: 13px 14px;
    color: #eef7ff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.advanced-options[open] summary {
    border-bottom: 1px solid rgba(203, 223, 245, 0.22);
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
    padding: 14px;
}

.advanced-grid label > span {
    color: var(--orange-2);
    font-size: 12px;
    font-weight: 900;
}

.order-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.order-summary div {
    min-height: 72px;
    display: grid;
    align-content: center;
    gap: 5px;
    border: 1px solid rgba(203, 223, 245, 0.28);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.order-summary span {
    color: #d8e8f7;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.order-summary strong {
    color: var(--orange-2);
    font-size: 20px;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

button {
    margin-top: 8px;
    padding: 14px 18px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--panel);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(255, 151, 15, 0.26);
}

.secondary-action {
    border: 1px solid rgba(203, 223, 245, 0.36);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    box-shadow: none;
}

button:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.quote-link {
    display: inline-flex;
    justify-content: center;
    color: var(--orange-2);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.quote-link:hover {
    color: var(--white);
}

.form-status {
    min-height: 22px;
    margin: -4px 0 0;
    color: var(--orange-2);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.35;
}

.dicas {
    margin-top: 22px;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(203, 223, 245, 0.22);
    color: #d8e8f7;
    line-height: 1.4;
}

.dicas strong {
    color: var(--orange-2);
}

.preview {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    min-width: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(230, 243, 255, 0.88)),
        radial-gradient(circle at 78% 12%, rgba(0, 109, 255, 0.16), transparent 30%);
}

#canvas-container {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    overflow: hidden;
}

#canvas-container canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 100% !important;
}

@media (max-width: 880px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .painel {
        border-right: none;
        border-bottom: 5px solid var(--orange);
    }

    .preview {
        position: relative;
        height: auto;
    }

    #canvas-container {
        height: 70vh;
        min-height: 440px;
    }
}

@media (max-width: 520px) {
    .painel {
        padding: 22px;
    }

    .linha {
        grid-template-columns: 1fr;
    }

    .platform-options,
    .advanced-grid {
        grid-template-columns: 1fr 1fr;
    }

    .funnel-steps,
    .order-summary,
    .action-row {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 26px;
    }
}
