* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.editor-section, .preview-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 32px;
    text-align: center;
    background: linear-gradient(135deg, #8BC53F 0%, #6a9c2f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
}

h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 18px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #8BC53F;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section {
    background: #fafafa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
}

.button-container {
    text-align: center;
    padding: 20px 0;
}

label i {
    margin-right: 8px;
    color: #8BC53F;
    width: 20px;
    display: inline-block;
}

button i {
    margin-right: 8px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="url"],
input[type="email"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    background: #fafafa;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #8BC53F;
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 197, 63, 0.1);
}

input.invalid {
    border-color: #e74c3c;
    background: #fff5f5;
}

.error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    background: linear-gradient(135deg, #8BC53F 0%, #6a9c2f 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    margin-top: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 197, 63, 0.3);
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 197, 63, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

#guardar-qr-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#guardar-qr-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Tarjeta estilo CEMGI mejorado */
.tarjeta {
    background: white;
    border-radius: 0;
    overflow: hidden;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.tarjeta:hover {
    transform: translateY(-5px);
}

.tarjeta-header-green {
    background: #8BC53F;
    padding: 5px 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.tarjeta-header-green img {
    width: 95%;
    max-width: 450px;
    height: auto;
}

#preview-logo {
    width: 95%;
    max-width: 450px;
    height: auto;
}

.tarjeta-nombre-section {
    background: #ffffff;
    padding: 40px 30px;
    text-align: center;
    flex: 0 0 auto;
    overflow: hidden;
}

#preview-nombre {
    color: #666;
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0;
    line-height: 1.3;
    font-family: 'Montserrat', sans-serif;
}

#preview-puesto {
    color: #999;
    font-size: 20px;
    font-weight: 300;
    font-style: normal;
    line-height: 1.3;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    font-family: 'Montserrat', sans-serif;
}

.tarjeta-contacto-section {
    background: #8BC53F;
    padding: 30px 30px;
    color: white;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.contacto-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    font-size: 15px;
    transition: none;
    font-family: 'Montserrat', sans-serif;
}

.contacto-item:hover {
    transform: none;
}

.contacto-item:last-of-type {
    margin-bottom: 0;
}

.contacto-item i {
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8BC53F;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 19px;
    margin-top: 2px;
    box-shadow: none;
}

.contacto-item span {
    line-height: 1.5;
    font-weight: 300;
    padding-top: 4px;
}

.contacto-item a {
    color: white !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.contacto-item a:visited {
    color: white !important;
}

.contacto-item a:hover {
    color: white !important;
    border-bottom: none !important;
}

.contacto-item-doble {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
}

.contacto-subitem {
    display: flex;
    align-items: flex-start;
    flex: 1;
}

.contacto-subitem i {
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8BC53F;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 19px;
    margin-top: 2px;
    box-shadow: none;
}

.contacto-subitem span {
    line-height: 1.5;
    font-weight: 300;
    padding-top: 4px;
}

.contacto-subitem a {
    color: white !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.contacto-subitem a:visited {
    color: white !important;
}

.contacto-subitem a:hover {
    color: white !important;
    border-bottom: none !important;
}

.empresa-nombre {
    font-weight: 500;
    font-size: 18px;
    margin: 0;
    margin-top: 15px;
    margin-bottom: 10px;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    display: block;
    font-family: 'Montserrat', sans-serif;
}

.redes-sociales {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 0;
    margin-bottom: 0;
}

.red-social-btn {
    width: 46px;
    height: 46px;
    border-radius: 50% !important;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 21px;
    color: #8BC53F;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: none;
}

.red-social-btn i {
    line-height: 1;
}

.red-social-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.tarjeta-footer-white {
    background: #f5f5f5;
    padding: 25px 30px;
    text-align: center;
    color: #999;
    font-size: 16px;
    font-weight: 400;
    margin-top: auto;
    flex: 0 0 auto;
    border-top: none;
}

.tarjeta-footer-white a {
    color: #999 !important;
    text-decoration: none !important;
    word-break: break-all;
    transition: none;
}

.tarjeta-footer-white a:visited {
    color: #999 !important;
}

.tarjeta-footer-white a:hover {
    color: #666 !important;
}

.website-verde {
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.website-verde a {
    color: white !important;
    text-decoration: none !important;
    font-size: 22px;
    font-weight: 500;
    display: inline-block;
}

.website-verde a:visited {
    color: white !important;
}

.website-verde a:hover {
    color: white !important;
    text-decoration: underline !important;
}

#qr-container {
    margin-top: 35px;
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 15px;
}

#qr-container h3 {
    color: #333;
    border: none;
    margin-bottom: 20px;
}

#qr-canvas {
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.qr-wrapper {
    position: relative;
    width: 350px;
    height: 350px;
    background: white;
    padding: 25px;
    border-radius: 30px;
    border: 8px solid #8BC53F;
    box-shadow: 0 10px 40px rgba(139, 197, 63, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-image {
    width: 100%;
    height: 100%;
    display: block;
}

.qr-logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-logo-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-nombre-badge {
    background: linear-gradient(135deg, #8BC53F 0%, #6a9c2f 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 600;
    margin-top: -20px;
    box-shadow: 0 6px 20px rgba(139, 197, 63, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    position: relative;
    font-family: 'Montserrat', sans-serif;
}

.qr-nombre-badge i {
    font-size: 24px;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .tarjeta {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .editor-section, .preview-section {
        padding: 25px;
    }
    
    h1 {
        font-size: 26px;
    }
}

#qr-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}
