:root {
    --primary: #2756e8;
    --primary-dark: #1c43bf;
    --secondary: #7048e8;
    --background: #f4f6fa;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e1e5ec;
    --success: #087443;
    --success-background: #ecfdf3;
    --danger: #b42318;
    --danger-background: #fef3f2;
    --shadow: 0 20px 55px rgba(23, 32, 51, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background:
        radial-gradient(
            circle at top left,
            rgba(39, 86, 232, 0.1),
            transparent 500px
        ),
        var(--background);
    color: var(--text);
}

button,
textarea,
select,
input {
    font: inherit;
}

.header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
}

.header-content {
    width: min(1200px, calc(100% - 40px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.brand-symbol {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color: white;
    font-size: 14px;
    font-weight: 800;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 999px;
    background: var(--success-background);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.system-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12b76a;
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 55px 0 70px;
}

.presentation {
    max-width: 730px;
    margin-bottom: 36px;
}

.tag,
.preview-title > span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.presentation h1 {
    margin: 10px 0 13px;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.presentation p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
    gap: 28px;
    align-items: start;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.form-panel {
    padding: 32px;
}

.preview-panel {
    position: sticky;
    top: 24px;
    padding: 28px;
}

.section-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}

.section-title > span {
    width: 33px;
    height: 33px;
    flex: 0 0 33px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
}

.section-title h2,
.preview-title h2 {
    margin: 0;
    font-size: 21px;
}

.section-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.customization-title {
    margin-top: 34px;
}

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

.field label {
    font-size: 14px;
    font-weight: 700;
}

textarea,
select,
.color-field input[type="text"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 140px;
    padding: 15px;
    resize: vertical;
    line-height: 1.5;
}

select,
.color-field input[type="text"] {
    min-height: 46px;
    padding: 0 13px;
}

textarea:focus,
select:focus,
.color-field input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(39, 86, 232, 0.1);
}

.field-information {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

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

.color-field {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
}

.color-field input[type="color"] {
    width: 52px;
    height: 46px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
}

.primary-button,
.download-button {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-weight: 800;
    text-decoration: none;
}

.primary-button {
    width: 100%;
    margin-top: 30px;
    border: none;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color: white;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(39, 86, 232, 0.24);
}

.primary-button:hover,
.download-button:not(.disabled):hover {
    transform: translateY(-1px);
}

.primary-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.message {
    display: none;
    margin-top: 17px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
}

.message.success {
    display: block;
    background: var(--success-background);
    color: var(--success);
}

.message.error {
    display: block;
    background: var(--danger-background);
    color: var(--danger);
}

.preview-title {
    margin-bottom: 19px;
}

.preview-title h2 {
    margin-top: 6px;
}

.preview-area {
    min-height: 390px;
    display: grid;
    place-items: center;
    padding: 25px;
    border: 1px dashed #cdd3de;
    border-radius: 18px;
    background: #f8fafc;
}

.empty-preview {
    max-width: 260px;
    text-align: center;
}

.empty-preview strong {
    display: block;
    margin-top: 18px;
}

.empty-preview p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.qr-placeholder {
    width: 92px;
    height: 92px;
    margin: 0 auto;
    position: relative;
    border: 5px solid #d5dae3;
    border-radius: 12px;
}

.qr-placeholder span {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 5px solid #d5dae3;
}

.qr-placeholder span:nth-child(1) {
    top: 9px;
    left: 9px;
}

.qr-placeholder span:nth-child(2) {
    top: 9px;
    right: 9px;
}

.qr-placeholder span:nth-child(3) {
    bottom: 9px;
    left: 9px;
}

#qr-preview {
    display: block;
    width: min(100%, 350px);
    height: auto;
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(23, 32, 51, 0.15);
}

#qr-preview[hidden] {
    display: none;
}

.download-button {
    margin-top: 18px;
    background: var(--text);
    color: white;
}

.download-button.disabled {
    pointer-events: none;
    opacity: 0.35;
}

.privacy-note {
    margin-top: 22px;
    padding: 15px;
    border-radius: 14px;
    background: #f8fafc;
}

.privacy-note strong {
    font-size: 13px;
}

.privacy-note p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

footer {
    padding: 22px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

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

    .preview-panel {
        position: static;
    }
}

@media (max-width: 620px) {
    .header-content,
    .container {
        width: min(100% - 24px, 1200px);
    }

    .brand span,
    .system-status {
        display: none;
    }

    .container {
        padding-top: 36px;
    }

    .form-panel,
    .preview-panel {
        padding: 22px;
        border-radius: 18px;
    }

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

    .field-information {
        flex-direction: column;
        gap: 5px;
    }

    .preview-area {
        min-height: 320px;
    }
}


/* AI2GO QR BRANDING */

.brand-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 18px;
    color: inherit;
    text-decoration: none;
}

.brand-logo-image {
    width: clamp(230px, 28vw, 390px);
    max-height: 64px;
    display: block;
    object-fit: contain;
    object-position: left center;
}

.brand-product {
    min-width: 0;
    padding-left: 18px;
    border-left: 1px solid rgba(148, 163, 184, 0.35);
}

.brand-product strong,
.brand-product span {
    display: block;
}

.brand-product strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.brand-product span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.brand-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.brand-footer img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-footer span {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 850px) {
    .brand-logo-image {
        width: clamp(190px, 38vw, 290px);
        max-height: 54px;
    }

    .brand-product span {
        display: none;
    }
}

@media (max-width: 620px) {
    .brand-link {
        gap: 10px;
    }

    .brand-logo-image {
        width: 180px;
        max-height: 48px;
    }

    .brand-product {
        padding-left: 10px;
    }

    .brand-product strong {
        font-size: 12px;
    }
}

@media (max-width: 430px) {
    .brand-logo-image {
        width: 155px;
    }

    .brand-product {
        display: none;
    }
}
