:root {
    --primary-blue: #0066cc;
    --dark-blue: #004d99;
    --light-blue: #e6f2ff;
    --black: #333;
    --white: #fff;
}

* {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #e3f0ff 0%, #f4f8fd 100%);
    background: #e3f0ff;
    margin: 0; 
    padding: 0; 
}

header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: calc(100%);
    padding: 20px 0;
    background: white;
    border-bottom: 1px solid #deebfd;
}

header .header-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header .logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
}

header .logo svg {
    width: 40px;
    height: 40px;
    vertical-align: middle;
    margin-right: 10px;
}

header .logo svg g {
    fill: var(--primary-blue);
}

header h1 {
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    font-size: 24px;
    color: var(--primary-blue);
}

header .buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

header .buttons .button {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #0066cc;
    font-weight: 500;
    height: 45px;
    padding: 0 30px;
    border: 1px solid #0066cc;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

header .buttons .button:first-child:hover {
    border-color: #014fa3;
    color: #014fa3;
}

header .buttons .button:last-child {
    background: #0066cc;
    color: white;
}

header .buttons .button:last-child:hover {
    background: #014fa3;
    border-color: #014fa3;
    color: white;
}

.container { 
    margin: 40px auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: 1200px;
    background: #f0f4fc;
    gap: 20px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,123,255,0.10), 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.header {
    margin-top: -25px;
    margin-left: -24px;
    margin-bottom: 20px;
    width: calc(100%);
    text-align: start;
    padding: 5px 24px;
    background: #0066cc;
    color: #fff;
}

.header h1 {
    margin: 10px 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
    color: #fff;
    font-size: 1.6em;
}

.form-group { 
    display: flex;
    flex-direction: column;
    width: calc(66% - 220px);
    padding: 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 1px 4px rgba(0,123,255,0.1);
}

.form-group.type { 
    width: 150px;
}

.form-group.qr {
    align-items: center;
}

.qr-input-section {
    width: 100%;
}

label { 
    display: block; 
    margin-bottom: 6px; 
    color: #0056b3;
    font-weight: 500;
}

.title-type,
.title-custom { 
    display: flex; 
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px; 
    color: #0056b3;
    font-size: 1.2em;
    font-weight: 500;
}

.title-type svg,
.title-custom svg { 
    display: none;
    margin-right: 10px;
    width: 24px; 
    height: 24px;
    transition: .5s;
    stroke: #0056b3;
}

.title-type.active svg,
.title-custom.active svg {
    transform: rotate(180deg);
}

input[type="color"] { 
    width: 100%;
    border: none;
    outline: none;
    appearance: none;
    padding: 0;
    background: none;
}

input[type="text"], select { 
    width: calc(100% - 16px); 
    padding: 8px; 
    border-radius: 4px; 
    border: 1px solid #e7f1ff;
    background: #f8fbff;
    transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
    border-color: #007bff;
    outline: none;
}

input[type="color"] {
    width: 0;
    height: 0;
    opacity: 0;
}

button { 
    padding: 10px 20px; 
    border: none; 
    background: #007bff;
    color: #fff; 
    border-radius: 4px; 
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,123,255,0.08);
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background: #0056b3;
}

button:disabled { 
    background: #b3d1ff; 
    color: #fff;
    cursor: not-allowed;
}



#url {
    margin-bottom: 20px;
    width: calc(100% - 22px);
    height: 25px;
    padding: 8px 11px;
    border-radius: 10px;
    border: 1px solid #007bff;
}

#url::placeholder {
    color: #104883;
}

.groups { 
    display: flex; 
    justify-content: space-between;
    flex-wrap: wrap;
}

.customization .groups { 
    margin-top: 15px;
}

.groups.colors { 
    display: flex; 
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
}

.group {
    display: flex;
    flex-direction: column;
    width: calc(50% - 8px);
}

.groups:nth-child(2) .group { 
    width: 100%;
    margin-top: 10px;
}

#qrType {
    width: 100%;
}

.qr-types-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.qr-types-buttons .type-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: calc(50% - 8px);
    gap: 5px;
    font-size: 0.9em;
    cursor: default;
}

.qr-types-buttons .type-button .type-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: calc(80% - 29px);
    padding: 14.5px;
    background: #f6faff;
    border-radius: 10px;
    border: 2px solid #f6faff;
    cursor: pointer;
}

.qr-types-buttons .type-button.active .type-icon {
    background: white;
    border-color: #007bff;
}

.qr-types-buttons .type-button.active .type-icon svg.fill,
.qr-types-buttons .type-button.active .type-icon svg .fill {
    fill: #007bff;
}

.qr-types-buttons .type-button.active .type-icon svg.stroke,
.qr-types-buttons .type-button.active .type-icon svg .stroke {
    stroke: #007bff;
}

.qr-types-buttons .type-button .type-icon:hover {
    background: #e3f0ff;
}

.point-shapes-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: start;
}

.point-shape-button {
    width: 37.5px;
    height: 37.5px;
    background: #f6faff;
    border: 2px solid #f6faff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

.point-shape-button.active {
    background: white;
    border-color: #007bff;
}

.point-shape-button:hover {
    background: #e3f0ff;
}

.color-button {
    width: 37.5px;
    height: 37.5px;
    background: #f6faff;
    border: 2px solid #f6faff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

.color-button button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    appearance: none;
    padding: 0;
    background: conic-gradient(red, orange, yellow, green, cyan, blue, violet, indigo, red);
    border-radius: 50%;
    cursor: pointer;
    transition: .5s;
}

.color-button button svg {
    margin-top: -0.35px;
    width: 20px;
    height: 20px;
    border-radius: 20px;
    background: white;
}

.color-button button:hover {
    background: conic-gradient(rgb(156, 0, 0), rgb(163, 106, 0), rgb(177, 177, 0), rgb(0, 66, 0), rgb(0, 126, 126), rgb(0, 0, 143), rgb(143, 72, 143), rgb(36, 0, 61), rgb(150, 0, 0));
}

.corner-shapes-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: start;
}

.corner-shapes-buttons .corner-shape-button {
    width: 37.5px;
    height: 37.5px;
    background: #f6faff;
    border: 2px solid #f6faff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

.corner-shape-button.active {
    background: white;
    border-color: #007bff;
}

.corner-shape-button:hover {
    background: #e3f0ff;
}

.corner-inner-shapes-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: start;
}

.corner-inner-shapes-buttons .corner-inner-shape-button {
    width: 37.5px;
    height: 37.5px;
    background: #f6faff;
    border: 2px solid #f6faff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
}

.corner-inner-shapes-buttons .corner-inner-shape-button.active {
    background: white;
    border-color: #007bff;
}

.corner-inner-shapes-buttons .corner-inner-shape-button:hover {
    background: #e3f0ff;
}

.title {
    font-size: 1.2em;
    color: #0056b3;
    width: 100%;
    margin-bottom: 10px;
}

.input-logo {
    position: relative;
    margin-top: 10px;
    width: calc(100% - 35px);
    padding: 15px;
    background: #f5faff;
    border: 1px dashed #007bff;
    border-radius: 10px;
    overflow: hidden;
}

.input-logo .input-header {
    display: flex;
    flex-direction: row;
    align-items: start;
    gap: 15px;
}

.input-logo .input-header svg {
    width: 40px;
    height: 40px;
}

.input-logo .input-header svg g {
    fill: #5f89b6;
}

.input-logo .input-header span {
    font-size: 18px;
    color: #0056b3;
    font-weight: 500;
}

.input-logo .input-header p {
    margin: 0;
    margin-top: 2px;
    font-size: 16px;
    color: #5f89b6;
}

.upload-logo {
    margin-top: 15px;
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #a4beda;
    background: #fafcfd;
    overflow: hidden;
    cursor: pointer;
}

.upload-logo .upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e3f0ff;
    border-right: 1px solid #a4beda;
    padding: 0 10px;
    cursor: pointer;
}

.upload-logo .upload-name {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.input-logo #logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.qr-preview { 
    position: relative;
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    margin: 24px 0; 
    gap: 10px;
}

#qrsvg {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 176px;
    height: 176px;
    padding: 12px;
}

#qrsvg.hide {
    display: none;
}

#qrsvg svg {
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.1;
}

#qr { 
    width: 200px;
    height: 200px;
    background: #f8fbff;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid #cbe1ff;
}

#qr canvas {
    background: white;
    z-index: 5;
}

.qr-error {
    display:none;
    color:red;
    font-size:14px;
    text-align:center;
    margin-bottom:20px;
}

.customization { 
    display: flex;
    flex-direction: column;
    flex-wrap: wrap; 
    overflow: hidden;
    gap: 12px;
    width: calc(33% - 10px);
    padding: 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 1px 4px rgba(0,123,255,0.1);
}

.customization.show { 
    height: auto;
}

.form-group.type.show {
    height: auto;
}

.form-group.type.show .qr-types-buttons .type-button,
.form-group.type.show .qr-types-buttons .type-button:nth-child(5),
.form-group.type.show .qr-types-buttons .type-button:nth-child(6),
.form-group.type.show .qr-types-buttons .type-button:nth-child(7),
.form-group.type.show .qr-types-buttons .type-button:nth-child(8) {
    display: flex;
}

.customization > div { 
    /*flex: 1 1 180px; 
    background: #e8f2ff;
    border-radius: 15px;
    margin: 0;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0,123,255,0.04);*/
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    width: 100%;
}

#logo-preview { 
    max-width: 80px; 
    max-height: 80px; 
    display: block; 
    margin: 8px auto; 
    border-radius: 8px;
    border: 2px solid #b3d1ff;
    background: #fff;
}

footer {
    margin-top:-20px;
    margin-bottom: 10px;
    text-align:center;
    padding:10px;
    color:#555;
}

footer a {
    color: #555;
    text-decoration: none;
}

footer a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Estilos para la sección de descarga */
.download-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    text-align: center;
    gap: 15px;
    width: 100%;
}

.download-buttons-desktop {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.download-buttons-mobile {
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
}

.download-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-toggle:hover:not(:disabled) {
    background: var(--dark-blue);
}

.download-toggle:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.download-toggle .download-arrow {
    display: none;
    transition: transform 0.3s ease;
}

.download-toggle.active .download-arrow {
    transform: rotate(180deg);
}

.download-options {
    position: absolute;
    top: calc(100% + 10px);
    display: flex;
    flex-direction: row;
    gap: 10px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.download-options.active {
    opacity: 1;
    max-height: 60px;
}

.download-options button {
    padding: 10px 20px;
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
}

.download-options button:hover:not(:disabled) {
    background: var(--primary-blue);
    color: white;
}

.download-options button:disabled {
    background: #f5f5f5;
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 700px) {
    body {
        padding-top: 60px; /* Espacio para el header fijo */
    }

    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: calc(100% - 40px);
        height: 40px;
        padding: 10px 20px;
        z-index: 1000;
        background: white;
        box-shadow: none;
    }

    header .header-content {
        padding: 0;
    }
    
    header .logo svg {
        width: 30px;
        height: 30px;
    }
    
    header h1 {
        font-size: 18px;
    }

    .container {
        flex-direction: column;
        max-width: 100%;
        margin: 0;
        gap: 0;
        padding: 20px 0;
        padding-top: 0;
        border-radius: 0;
    }

    .form-group {
        width: calc(100% - 40px)!important;
    }

    .form-group.type {
        order: 2;
        height: calc(15vw + 65px);
        margin-top: calc(400px);
        border-radius: 0;
        height: 25px;
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .form-group.type.input-hidden {
        margin-top: calc(400px - 77px);
    }

    .form-group.qr {
        order: 0;
        position: fixed;
        top: 60px; /* Debajo del header */
        left: 0;
        right: 0;
        width: calc(100%);
        margin: 0 0;
        background: white;
        border-radius: 0;
        box-shadow: none;
        z-index: 999;
        padding: 20px;
        overflow: visible;
        transition: all 0.3s ease;
    }

    .form-group.qr.scrolled {
        padding: 10px 20px;
    }

    .qr-input-section {
        transition: all 0.3s ease;
        width: 100%;
        max-height: 120px;
        overflow: hidden;
    }

    .qr-input-section.hidden {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
        padding: 0;
    }

    .qr-input-label {
        transition: all 0.3s ease;
        margin-bottom: 8px;
        display: block;
    }

    .qr-input-field {
        transition: all 0.3s ease;
        margin-bottom: 15px;
    }

    .form-group.qr #qr {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 200px;
        transition: all 0.3s ease;
    }

    .form-group.qr.scrolled #qr {
        min-height: 150px;
    }

    .form-group.qr .qr-error {
        text-align: center;
        margin-top: 10px;
    }

    .form-group.qr .form-group {
        margin-top: 10px;
    }

    .form-group.qr #generateBtn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        display: block;
    }

    /* Estilos para los botones de descarga en móviles */
    .download-buttons-desktop {
        display: none;
    }

    .download-buttons-mobile {
        position: relative;
        display: flex;
    }

    .qr-types-buttons {
        justify-content: space-between;
        width: 100%;
    }

    .qr-types-buttons .type-button {
        width: calc(25vw - 20px);
    }

    .qr-types-buttons .type-button .type-icon {
        width: calc(13vw - 20px);
        height: calc(13vw - 20px);
    }

    .qr-types-buttons .type-button svg {
        width: 25px;
        height: 25px;
    }

    .qr-types-buttons .type-button,
    .qr-types-buttons .type-button:nth-child(5),
    .qr-types-buttons .type-button:nth-child(6),
    .qr-types-buttons .type-button:nth-child(7),
    .qr-types-buttons .type-button:nth-child(8) {
        display: none;
    }

    #url {
        margin-bottom: 0;
        width: calc(100% - 24px);
    }

    .container h1 {
        margin-top: 30px;
        gap: 15px;
        align-items: center;
        font-size: 22px;
    }

    .container h1 svg {
        width: 30px;
        height: 30px;
    }

    .group {
        width: calc(100% - 16px);
    }

    .groups .group {
        width: calc(50% - 8px);
        margin-top: 10px;
    }

    .groups .group label {
        font-size: 1.2em;
    }

    .customization {
        order: 3;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 15px;
        width: calc(100% - 40px);
        height: 20px;
        border-radius: 0;
        transition: all 0.3s ease;
        margin-bottom: 0px; /* Espacio para los botones de descarga fijos */
    }

    .customization > div {
        flex: 1 1 100%;
        width: calc(100%);
        border-radius: 10px;
    }

    .title-type,
    .title-custom {
        flex-direction: row!important;
        justify-content: space-between!important;
        width: 100%;
        cursor: pointer;
        margin: 0;
    }

    .customization .groups {
        margin-top: 0;
    }

    .title-type .title {
        margin: 0;
        font-size: 19px;
    }

    .title-type svg,
    .title-custom svg { 
        margin: 0;
        display: block;
    }

    #qr {
        padding: 6px;
    }

    #qrsvg {
        left: 6px;
        bottom: 6px;
    }

    footer {
        margin-top: 20px;
        margin-bottom: 120px; /* Espacio para los botones de descarga fijos */
        width: calc(100% - 20px);
    }
}
@media (max-width: 400px) {
    h1 {
        font-size: 1.2em;
    }
}