* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: #f4f6f8;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #111827;
    color: white;
}

.badge.free {
    background: #22c55e;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.app {
    display: flex;
    min-height: calc(100vh - 56px);
}

.controls {
    width: 360px;
    background: white;
    padding: 20px;
    overflow-y: auto;
}

.controls section {
    margin-bottom: 18px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-right: 42px;
}

#clearInput {
    position: absolute;
    right: 10px;
    top: 30%;
    transform: translateY(-50%);

    height: 24px;
    width: 24px;

    display: none;
    align-items: center;
    justify-content: center;

    border: none;
    background: transparent;
    cursor: pointer;
    color: #6b7280;
}

#clearInput .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

#clearInput:hover {
    color: #111827;
}


label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

input,
select,
button {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
}

#logo {
    display: none;
}

.collapse-toggle {
    background: #f9fafb;
    font-weight: 600;
    cursor: pointer;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.preset-grid button {
    background: #f3f4f6;
    font-weight: 600;
    cursor: pointer;
}

#customGradientBtn,
#customGradientPanel {
    grid-column: 1 / -1;
}


.hidden {
    display: none;
}

.actions button {
    background: #111827;
    color: white;
    border: none;
}

button.secondary {
    background: #e5e7eb;
    color: #111;
}

.preview {
    flex: 1;
    background: linear-gradient(135deg, #eef2ff, #f9fafb);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-card {
    background: white;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
}

#qr {
    display: flex;
    align-items: center;
    justify-content: center;
}

#qr svg {
    display: block;
    shape-rendering: crispEdges;
    image-rendering: pixelated;
}

.brand-check {
    font-size: 13px;
    background: #f9fafb;
    padding: 10px;
    border-radius: 10px;
}

.good {
    color: #16a34a;
}

.warn {
    color: #ca8a04;
}

/* LOGO PICKER */
.logo-box {
    width: 120px;
    aspect-ratio: 1 / 1;
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    cursor: pointer;
    overflow: hidden;
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    padding: 8px;
}

.mobile-dock,
.mobile-drawer {
    display: none;
}


.actions button+button {
    margin-top: 10px;
}

.controls section,
.drawer-content section {
    margin-bottom: 18px;
}

.controls section:last-child,
.drawer-content section:last-child {
    margin-bottom: 0;
}

.drawer-content .actions {
    margin-top: 12px;
}

/* Custom gradient panel */
.custom-gradient {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    width: 100%;
}


.custom-gradient.hidden {
    display: none;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.color-row label {
    width: 40px;
    font-size: 12px;
}

.color-row input[type="text"] {
    flex: 1;
    min-width: 120px;
    font-family: monospace;
}

.color-row input[type="text"] {
    flex: 1;
    font-family: monospace;
}




@media (max-width: 900px) and (orientation: portrait) {

    .app {
        flex-direction: column;
    }

    .controls {
        display: none;
    }

    .preview {
        flex: 1;
        padding-bottom: 90px;
    }

    .mobile-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        justify-content: space-around;
        align-items: center;
        z-index: 50;
    }

    .mobile-dock button {
        background: none;
        border: none;
        cursor: pointer;
        color: #111827;
    }

    .mobile-dock .material-symbols-rounded {
        font-size: 28px;
    }

    /* Drawer overlay */
    .mobile-drawer {
        display: flex;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 60;
        justify-content: center;
        align-items: flex-end;
    }

    .mobile-drawer.hidden {
        display: none;
    }

    .drawer-content {
        background: white;
        width: 100%;
        max-height: 85%;
        border-radius: 18px 18px 0 0;
        padding: 20px;
        overflow-y: auto;
        animation: slideUp 0.25s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }


}
