﻿:root {
    --primary-color: #ff3399;
    --primary-dark: #cc0066;
    --secondary-color: #0ea3af;
    --gradient-primary: linear-gradient(135deg, #ff3399 0%, #ff66cc 100%);
    --gradient-secondary: linear-gradient(135deg, #0ea3af 0%, #2ecad5 100%);
    --gradient-ter:  linear-gradient(135deg, #cb356b 0%, #bd3f32 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
}

/* ESTILOS BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================ */
/* DISEÑO PARA DESKTOP (pantalla dividida) */
/* ============================================ */
/*@media (min-width: 992px) {*/
@media (min-width: 768px) {
        body {
            margin: 0;
            padding: 0;
            min-height: 100vh;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            overflow-x: hidden;
            background: white;
        }

        form#form1 {
            display: block;
            width: 100%;
            margin: 0;
            padding: 0;
            min-height: 100vh;
        }

        .container {
            display: flex !important;
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            min-height: 100vh;
        }

        /* SECCIÓN IZQUIERDA 30% */
        .text-center.mb-3 {
            width: 30% !important;
            background: var(--gradient-primary) !important;
            display: flex !important;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 0 !important;
            padding: 40px !important;
            min-height: 100vh;
            animation: slideFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
            opacity: 0;
            transform: translateX(-50px);
        }

        /* SECCIÓN DERECHA 70% */
        .dni-container,
        .qr-container,
        .error-container,
        .loading {
            width: 70% !important;
            background: white !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            margin: 0 !important;
            padding: 40px !important;
            min-height: 100vh;
            animation: slideFromRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
            opacity: 0;
            transform: translateX(50px);
        }

        .logo-circle {
            width: 120px;
            height: 120px;
            margin: 0 auto 20px auto;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow);
            transition: transform 0.3s ease;
        }

            .logo-circle:hover {
                transform: scale(1.05);
            }

        .logo-img {
            width: 70px;
            height: auto;
            max-height: 70px;
        }

        .text-white {
            font-size: 2rem !important;
            margin-top: 0.5rem !important;
            color: white !important;
            font-weight: bold;
        }

        .text-white-50 {
            font-size: 0.9rem !important;
            color: rgba(255, 255, 255, 0.9) !important;
        }

        .card {
            background: white !important;
            border-radius: 32px !important;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important;
            width: 100%;
            max-width: 700px !important;
            margin: 0 auto;
        }

        .card-header {
            border-radius: 32px 32px 0 0 !important;
            padding: 1.5rem !important;
        }

            .card-header h4 {
                font-size: 1.5rem !important;
            }

        .card-body {
            padding: 2rem !important;
        }

        .qr-img-large {
            max-width: 100% !important;
            width: 400px;
        }

        .qr-wrapper {
            position: relative;
            display: inline-block;
            margin-bottom: 1rem;
        }

        .container.mt-3 {
            margin-top: 0 !important;
        }

        .form-control {
            padding: 1rem 1.2rem !important;
            font-size: 1.1rem !important;
            border-radius: 16px !important;
        }

        .btn {
            padding: 1rem 1.5rem !important;
            font-size: 1.1rem !important;
            border-radius: 16px !important;
        }

        /* Loading en desktop */
        .loading {
            text-align: center;
        }

        .spinner-border {
            width: 4rem !important;
            height: 4rem !important;
        }
    }

    /* ============================================ */
    /* ANIMACIONES DE DESLIZAMIENTO */
    /* ============================================ */
    @keyframes slideFromLeft {
        0% {
            opacity: 0;
            transform: translateX(-80px);
        }

        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes slideFromRight {
        0% {
            opacity: 0;
            transform: translateX(80px);
        }

        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* ============================================ */
    /* DISEÑO PARA TABLETS */
    /* ============================================ */
    /*@media (min-width: 768px) and (max-width: 991px) {
        body {
            margin: 0;
            padding: 0;
            background: var(--gradient-primary);
        }

        .container {
            display: flex !important;
            flex-direction: column !important;
            padding: 40px !important;
            gap: 40px;
        }

        .text-center.mb-3 {
            display: block !important;
            text-align: center;
            margin-bottom: 1rem !important;
            width: 100% !important;
            background: transparent !important;
            min-height: auto !important;
            padding: 0 !important;
            animation: slideFromLeft 0.6s ease forwards;
            opacity: 0;
            transform: translateX(-30px);
        }

        .dni-container,
        .qr-container,
        .error-container,
        .loading {
            display: block !important;
            width: 100% !important;
            max-width: 600px;
            margin: 0 auto;
            background: transparent !important;
            min-height: auto !important;
            padding: 0 !important;
            animation: slideFromRight 0.6s ease forwards;
            opacity: 0;
            transform: translateX(30px);
        }

        .card {
            background: white !important;
            border-radius: 28px !important;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
        }

        .card-header {
            border-radius: 28px 28px 0 0 !important;
        }

        .logo-circle {
            width: 100px;
            height: 100px;
        }

        .logo-img {
            width: 60px;
            max-height: 60px;
        }

        .text-white {
            font-size: 2rem !important;
        }

        .qr-img-large {
            max-width: 300px !important;
        }
    }*/

    /* ============================================ */
    /* DISEÑO PARA MOBILE (logo arriba, diseño original) */
    /* ============================================ */
    @media (max-width: 767px) {
        body {
            background: var(--gradient-primary);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            padding: 20px 0;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        form#form1 {
            display: block;
            padding: 0;
            width: 100%;
        }

        .container {
            display: block !important;
            padding: 10px;
            margin: 0 auto;
        }

        .text-center.mb-3 {
            display: block !important;
            text-align: center;
            margin-bottom: 1rem !important;
            width: 100% !important;
            background: transparent !important;
            min-height: auto !important;
            padding: 0 !important;
            animation: fadeIn 0.5s ease;
        }

        .dni-container,
        .qr-container,
        .error-container,
        .loading {
            display: block !important;
            width: 100% !important;
            max-width: 500px;
            margin: 0 auto;
            background: transparent !important;
            min-height: auto !important;
            padding: 0 !important;
            animation: fadeIn 0.5s ease;
        }

        .card {
            background: rgba(255, 255, 255, 0.95) !important;
            border-radius: 20px !important;
            box-shadow: var(--shadow) !important;
        }

        .logo-circle {
            width: 65px;
            height: 65px;
            margin: 0 auto;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow);
        }

        .logo-img {
            width: 40px;
            max-height: 40px;
        }

        .text-white {
            font-size: 1.5rem;
            margin-top: 0.5rem !important;
            color: white !important;
        }

        .text-white-50 {
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.8) !important;
        }

        .qr-img-large {
            max-width: 220px;
        }

        .card-body {
            padding: 1.5rem;
        }

        .text-start p {
            flex-direction: column;
            align-items: flex-start;
            gap: 5px;
        }

        .dni-container,
        .qr-container,
        .error-container,
        .loading {
            margin: 1rem auto;
            width: calc(100% - 2rem);
        }
    }

    /* ============================================ */
    /* ESTILOS COMPARTIDOS */
    /* ============================================ */

    .card {
        border: none;
        overflow: hidden;
        margin: 0;
    }

        .card > :first-child {
            margin-top: 0 !important;
            border-top-left-radius: inherit !important;
            border-top-right-radius: inherit !important;
        }

    .card-header {
        border: none !important;
        padding: 1rem !important;
        margin: 0 !important;
        width: 100%;
        display: block;
    }

        .card-header.bg-primary {
            background: var(--gradient-primary) !important;
        }

        .card-header.bg-success {
            background: var(--gradient-primary) !important;
        }

        .card-header.bg-danger {
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        }

        .card-header h4 {
            margin: 0;
            font-weight: 600;
            font-size: 1.2rem;
        }

    .card-body {
        padding: 1.5rem;
    }

    .form-control {
        border: 2px solid #e9ecef;
        border-radius: 12px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        transition: all 0.3s ease;
    }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(255, 51, 153, 0.1);
        }

    .form-label {
        font-weight: 600;
        color: #333;
        margin-bottom: 0.5rem;
    }

    .text-muted {
        color: #6c757d !important;
        font-size: 0.8rem;
    }

    .btn {
        border-radius: 12px;
        padding: 0.75rem 1.5rem;
        font-weight: 600;
        transition: all 0.3s ease;
        border: none;
    }

    .btn-primary {
        background: var(--gradient-primary);
        color: white;
    }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(255, 51, 153, 0.4);
        }

    .qr-wrapper {
        position: relative;
        display: inline-block;
        margin-bottom: 1rem;
    }

    .qr-img-large {
        max-width: 280px;
        width: 400px;
        border-radius: 16px;
        padding: 15px;
        background: white;
        box-shadow: var(--shadow);
        transition: transform 0.3s ease;
    }

        .qr-img-large:hover {
            transform: scale(1.02);
        }

.btn-download-qr {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 20px; /* Cambiado de 50% a 20px para forma de píldora */
    width: auto; /* Cambiado de 36px a auto para que se ajuste al texto */
    min-width: 36px;
    height: 36px;
    padding: 0 12px; /* Espaciado horizontal para el texto */
    font-size: 0.7rem; /* Texto más pequeño para que quepa bien */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* Evita que el texto se rompa en varias líneas */
    letter-spacing: 0.5px;
}

    .btn-download-qr:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .loading {
        text-align: center;
        background: white;
        border-radius: var(--border-radius);
        padding: 2rem;
        box-shadow: var(--shadow);
    }

    .spinner-border {
        color: var(--primary-color);
    }

    .text-start p {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .text-start p:last-child {
            border-bottom: none;
        }

    .text-start strong {
        color: #555;
        font-size: 0.9rem;
    }

    .text-start .fw-bold {
        color: var(--primary-color);
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @media (max-width: 576px) {
        .card-body {
            padding: 1rem;
        }

        .qr-img-large {
            max-width: 220px;
        }

        .text-start p {
            flex-direction: column;
            align-items: flex-start;
            gap: 5px;
        }
    }

    /* ============================================ */
    /* MOBILE */
    /* ============================================ */
    @media (max-width: 767px) {
        body {
            background: white !important;
        }

        .dni-container,
        .qr-container,
        .error-container {
            padding: 20px !important;
        }

        .logo-circle {
            width: 90px !important;
            height: 90px !important;
        }

        .logo-img {
            width: 55px !important;
            height: auto;
            max-height: 55px !important;
        }

        .qr-img-large {
            max-width: 100% !important;
            width: 100%;
        }
    }