/**
 * Cassinax Softwares - QR Code Generator
 * Estilos específicos da ferramenta
 */

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.pagina-interna__container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center; /* Centraliza títulos e descrições */
}

    .pagina-interna__container h1,
    .pagina-interna__container > p {
        text-align: center;
    }

.qr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    text-align: left; /* Reset para conteúdo interno */
}

/* ============================================
   CARD DE CONFIGURAÇÕES
   ============================================ */
.qr-card {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

    .qr-card:hover {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

.qr-card__grupo {
    padding: 1.25rem 1.5rem;
}

.qr-card__separador {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}

/* ============================================
   INPUT - Centralizar label
   ============================================ */
.qr-card__grupo:first-child .qr-label {
    text-align: center;
}

.qr-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4b5563;
    text-align: center; /* Centraliza o label "URL ou Texto" */
}

/* ============================================
   OUTPUT (QR Code)
   ============================================ */
.qr-output {
    text-align: center;
}

.qr-container {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    transition: border 0.2s ease, border-radius 0.2s ease;
    overflow: hidden;
}

    .qr-container img {
        max-width: 100%;
        max-height: 100%;
    }

/* ============================================
   STATUS DO MODO
   ============================================ */
.qr-status {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: none;
}

.qr-status--local {
    background: #f3f4f6;
    color: #4b5563;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-weight: 600;
}

/* ============================================
   DICA
   ============================================ */
.qr-dica {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ============================================
   INPUT TEXTAREA
   ============================================ */
.qr-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

    .qr-input:focus {
        outline: none;
        border-color: #000000;
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    }

/* ============================================
   OPÇÕES (Tamanho + Borda na mesma linha)
   ============================================ */
.qr-opcoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   SELETOR DE TAMANHO
   ============================================ */
.tamanho-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tamanho-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #4b5563;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .tamanho-btn:hover {
        border-color: #000000;
        color: #000000;
        transform: translateY(-1px);
    }

.tamanho-btn--ativo {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

    .tamanho-btn--ativo:hover {
        background-color: #1f2937;
        color: #ffffff;
        transform: translateY(-1px);
    }

/* ============================================
   TOGGLE DE BORDA
   ============================================ */
.borda-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4b5563;
    font-family: inherit;
    background: none;
    border: none;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

    .borda-toggle:hover {
        color: #000000;
    }

.borda-toggle__pista {
    width: 44px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.borda-toggle--ativo .borda-toggle__pista {
    background-color: #000000;
}

.borda-toggle__botao {
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.borda-toggle--ativo .borda-toggle__botao {
    left: 22px;
}

.borda-toggle__texto {
    user-select: none;
}

/* ============================================
   BOTÕES DE AÇÃO
   ============================================ */
.qr-acoes {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: inherit;
}

.btn--preenchido {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

    .btn--preenchido:hover {
        background-color: #1f2937;
        border-color: #1f2937;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

.btn--perigo {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

    .btn--perigo:hover {
        background-color: #991b1b;
        border-color: #991b1b;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

/* ============================================
   DOWNLOAD - Área com transição suave
   ============================================ */
.qr-download-area {
    text-align: center;
    min-height: 60px;
    transition: all 0.3s ease;
}

    .qr-download-area:empty {
        min-height: 0;
    }

#btn-download {
    display: none;
    animation: slideDown 0.3s ease;
}

    #btn-download[style*="inline-flex"] {
        display: inline-flex !important;
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MENSAGEM DE FEEDBACK
   ============================================ */
.qr-mensagem {
    text-align: center;
    font-size: 0.8125rem;
    color: #9ca3af;
    min-height: 1.5em;
}

.qr-mensagem--erro {
    color: #dc2626;
}

.qr-mensagem--sucesso {
    color: #16a34a;
}

/* ============================================
   SPINNER
   ============================================ */
@keyframes qr-spin {
    to {
        transform: rotate(360deg);
    }
}

.qr-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #000000;
    border-radius: 50%;
    animation: qr-spin 0.8s linear infinite;
}

/* ============================================
   SEÇÃO "COMO USAR" - Centralizada
   ============================================ */
.qr-como-usar {
    margin-top: 3rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
    text-align: center;
}

    .qr-como-usar h3 {
        font-family: inherit;
        font-size: 1rem;
        margin-bottom: 1rem;
        font-weight: 700;
    }

    .qr-como-usar ol {
        color: #4b5563;
        font-size: 0.875rem;
        line-height: 1.8;
        padding-left: 0;
        list-style-position: inside;
        max-width: 500px;
        margin: 0 auto;
    }

    .qr-como-usar li {
        margin-bottom: 0.5rem;
    }

/* ============================================
   AVISO - Centralizado
   ============================================ */
.qr-aviso {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 700px) {
    .qr-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .qr-container {
        width: 220px;
        height: 220px;
    }

    .qr-opcoes {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .tamanho-selector {
        justify-content: center;
    }

    .borda-toggle {
        justify-content: center;
    }

    .qr-output {
        order: -1;
    }

    .qr-card__grupo {
        padding: 1rem;
    }

    .qr-acoes {
        flex-direction: column;
    }

    .qr-como-usar ol {
        text-align: left;
        padding-left: 1.5rem;
    }
}
