@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap');

/* ============================================
   VARIABLES Y RESET
   ============================================ */
:root {
    --bg-dark: #0D0D0D;
    --bg-darker: #0a0a0a;
    --surface: #1A1A1A;
    --text-light: #F2F2F2;
    --text-medium: #8A8A8A;
    --accent-cyan: #00E5FF;
    --accent-cyan-dim: rgba(0, 229, 255, 0.1);
    --border-color: rgba(242, 242, 242, 0.1);
    --error-color: #FF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   BODY Y LAYOUT BASE
   ============================================ */
body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-darker);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: rotate 60s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ============================================
   HEADER
   ============================================ */
header {
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan-dim) 50%, transparent);
    animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.logo {
    display: inline-block;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--text-medium) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.logo-by {
    font-size: 9px;
    font-weight: 400;
    color: var(--text-medium);
    letter-spacing: 2px;
    display: block;
    margin-top: 4px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    flex: 1;
    padding: 60px 0 80px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-medium);
    margin-bottom: 20px;
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    position: relative;
    animation: fadeInUp 0.6s ease forwards;
}

.page-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.page-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--text-medium) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.page-description {
    font-size: 15px;
    color: var(--text-medium);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 300;
    animation: fadeInUp 0.6s ease 0.3s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   QR LAYOUT
   ============================================ */
.qr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: rgba(242, 242, 242, 0.05);
    padding: 2px;
    margin-bottom: 40px;
}

.qr-panel {
    background: var(--bg-dark);
    padding: 50px 40px;
    position: relative;
    border: 1px solid var(--border-color);
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 30px;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 15px;
}

.panel-title::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.panel-title span:first-child {
    font-weight: 800;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 30px;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 12px;
}

input[type="text"],
input[type="file"],
select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]::placeholder {
    color: var(--text-medium);
    font-weight: 300;
}

input[type="text"]:focus,
input[type="file"]:focus,
select:focus {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
    box-shadow: 0 0 0 1px var(--accent-cyan);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238A8A8A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

input[type="file"] {
    padding: 12px;
    cursor: pointer;
    font-size: 13px;
}

input[type="file"]::file-selector-button {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 8px 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
}

input[type="file"]::file-selector-button:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

/* ============================================
   COLOR INPUTS
   ============================================ */
.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="color"] {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 4px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
}

input[type="color"]:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.color-value {
    font-size: 13px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: var(--text-light);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    flex: 1;
}

.color-label {
    font-size: 11px;
    color: var(--text-medium);
    font-weight: 400;
}

/* ============================================
   ADVANCED PARAMETERS
   ============================================ */
.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.param-label {
    font-size: 11px;
    color: var(--text-medium);
    font-weight: 400;
}

/* ============================================
   FILE INFO Y ERRORES
   ============================================ */
.file-info {
    font-size: 11px;
    color: var(--text-medium);
    margin-top: 8px;
    font-weight: 400;
}

.error {
    color: var(--error-color);
    font-size: 11px;
    margin-top: 8px;
    display: none;
    font-weight: 500;
}

.preview-logo {
    max-width: 120px;
    max-height: 120px;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    display: none;
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color) 50%, transparent);
    margin: 35px 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: transparent;
    color: var(--accent-cyan);
    border: 2px solid var(--accent-cyan);
    padding: 16px 40px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-cyan);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6), 0 0 40px rgba(0, 229, 255, 0.3);
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover svg {
    transform: scale(1.1);
}

/* ============================================
   DOWNLOAD OPTIONS
   ============================================ */
.download-options {
    display: none;
    margin-top: 30px;
    animation: fadeInUp 0.4s ease forwards;
}

.download-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 14px 30px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   QR DISPLAY
   ============================================ */
.qr-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.qr-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

#qrcode {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeInUp 0.5s ease forwards;
}

#qrcode canvas {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px var(--accent-cyan-dim);
    border: 2px solid rgba(0, 229, 255, 0.2);
    max-width: 100%;
    height: auto;
}

.qr-placeholder {
    text-align: center;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    padding: 20px;
}

.qr-placeholder svg {
    width: 80px;
    height: 80px;
    stroke: var(--text-medium);
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    position: relative;
    margin-top: auto;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan-dim) 50%, transparent);
}

.footer-content {
    text-align: center;
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 300;
}

.footer-logo {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--text-medium) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.footer-copyright {
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets */
@media (max-width: 968px) {
    .qr-layout {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 30px;
    }

    .qr-panel {
        padding: 40px 30px;
    }

    .page-header {
        margin-bottom: 50px;
    }

    main {
        padding: 50px 0 60px;
    }
}

/* Mobile Large */
@media (max-width: 640px) {
    .container {
        padding: 0 20px;
    }

    header {
        padding: 20px 0;
    }

    .logo-text {
        font-size: 20px;
    }

    .logo-by {
        font-size: 8px;
    }

    main {
        padding: 40px 0 50px;
    }

    .page-header {
        margin-bottom: 40px;
    }

    .page-label {
        font-size: 10px;
        letter-spacing: 2px;
        padding: 6px 12px;
    }

    .page-title {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .page-description {
        font-size: 14px;
    }

    .qr-panel {
        padding: 30px 20px;
    }

    .panel-title {
        font-size: 12px;
        gap: 10px;
    }

    .panel-title::before {
        width: 20px;
    }

    .color-grid,
    .params-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    input[type="color"] {
        width: 50px;
        height: 50px;
    }

    .color-value {
        font-size: 12px;
        padding: 8px 12px;
    }

    .qr-display {
        min-height: 350px;
    }

    #qrcode {
        padding: 20px;
    }

    .qr-placeholder svg {
        width: 60px;
        height: 60px;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }

    .btn-primary,
    .btn-download {
        padding: 14px 30px;
        font-size: 11px;
    }

    footer {
        padding: 30px 0;
    }
}

/* Mobile Small */
@media (max-width: 380px) {
    .container {
        padding: 0 16px;
    }

    .qr-panel {
        padding: 25px 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .btn-primary,
    .btn-download {
        padding: 12px 20px;
        font-size: 10px;
        gap: 8px;
    }

    .qr-display {
        min-height: 300px;
    }
}