* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: linear-gradient(135deg, rgba(46,125,50,0.82) 0%, rgba(27,94,32,0.88) 100%), url('fondo-tarjeta.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
}

.contenedor-centrado {
    max-width: 460px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tarjeta-card {
    background: white;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 30px 24px;
}

.login-card, .registro-card {
    padding: 35px 28px;
}

.logo-section {
    text-align: center;
    margin-bottom: 25px;
}

.icono-circulo,
.empresa-logo-placeholder {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.empresa-logo-grande {
    max-width: 90px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 8px;
}

.logo-section h1 {
    color: #2e7d32;
    font-size: 1.6em;
    margin-bottom: 6px;
}

.subtitulo {
    color: #666;
    font-size: 0.9em;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 11px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4caf50;
}

.ayuda-clave {
    font-size: 0.82em;
    color: #777;
    margin-bottom: 14px;
    font-style: italic;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.45);
}

.btn-secundario {
    background: white;
    color: #2e7d32;
    border: 2px solid #4caf50;
    flex: 1;
}

.btn-secundario:hover {
    background: #e8f5e9;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.9em;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-bienvenida {
    text-align: center;
    font-size: 1em;
    border-radius: 12px;
}

.link-secundario {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: #555;
}

.link-secundario a {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: none;
}

.link-secundario a:hover {
    text-decoration: underline;
}

.referentes-section {
    border-top: 2px dashed #ddd;
    padding-top: 16px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.referentes-title {
    color: #2e7d32;
    font-size: 0.95em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.referentes-badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.referente-bloque {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.referente-numero {
    font-size: 0.8em;
    font-weight: 700;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.empresa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8f5e9;
}

.empresa-logo-placeholder {
    font-size: 2em;
}

.empresa-logo-img {
    max-width: 60px;
    max-height: 50px;
    object-fit: contain;
    border-radius: 8px;
}

.empresa-nombre {
    font-weight: 700;
    color: #2e7d32;
    font-size: 1.1em;
}

.empresa-sub {
    font-size: 0.8em;
    color: #888;
}

.datos-cliente {
    margin-bottom: 20px;
}

.label-dato {
    font-size: 0.75em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    margin-top: 12px;
}

.label-dato:first-child {
    margin-top: 0;
}

.valor-dato {
    font-size: 1em;
    color: #333;
    font-weight: 500;
}

.valor-grande {
    font-size: 1.3em;
    font-weight: 700;
    color: #1b5e20;
}

.zona-barcode {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
}

.zona-barcode svg {
    max-width: 100%;
}

.codigo-texto {
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #444;
    letter-spacing: 1px;
    margin-top: 4px;
}

.acciones-tarjeta {
    display: flex;
    gap: 10px;
}

.btn-instalar {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: white;
    color: #1565c0;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.btn-instalar:hover {
    transform: translateY(-1px);
}

.aviso-ios {
    background: rgba(255,255,255,0.95);
    color: #333;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85em;
    text-align: center;
    line-height: 1.5;
}

.nota-pie {
    text-align: center;
    color: white;
    font-size: 0.85em;
    opacity: 0.9;
    padding: 0 10px;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    body {
        padding: 12px;
    }
    .tarjeta-card {
        padding: 22px 18px;
    }
}
