/* FORM_PARTICIPANTE.CSS - Mobile First */

:root { 
    --vinotinto: #800020; 
    --vinotinto-dark: #600018; 
    --vinotinto-rep: #2E8B57;
    --vinotinto-rep-dark: #1E6B47;
    --bg: #f4f4f4;
}

* { box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); margin: 0; padding: 15px; }

.container { max-width: 1200px; margin: 0 auto; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* Header */
.form-header { 
    background: linear-gradient(90deg, var(--vinotinto), var(--vinotinto-dark)); 
    color: white; padding: 20px; border-radius: 10px; margin-bottom: 20px; 
    display: flex; gap: 15px; align-items: center; 
    position: relative; flex-wrap: wrap;
}
.header-logo { height: 60px; }
.header-text h1 { margin: 0; font-size: 1.5rem; }
.header-text p { margin: 5px 0 0; font-size: 0.85rem; opacity: 0.9; }
.header-badge {
    position: absolute; top: 15px; right: 15px;
    background: rgba(255,255,255,0.2); padding: 5px 15px;
    border-radius: 20px; font-size: 12px; font-weight: 600;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Grid System - Mobile First */
.form-grid{ display:grid; grid-template-columns: 1fr; gap: 12px; }
.field{ background:#fdfdfd; padding:10px; border-radius:6px; border:1px solid #e0e0e0; }
.label{ font-size:11px; color:#444; margin-bottom:5px; display:block; font-weight:700; text-transform: uppercase; }
.input{ width:100%; padding:10px; border-radius:5px; border:1px solid #ccc; font-size:14px; font-family: inherit; }
.input-static { background:#f0f0f0; display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--vinotinto); pointer-events: none; }
.label.required::after { content: " *"; color: #DC3545; }

/* Notice */
.notice { background: rgba(52, 152, 219, 0.1); border-left: 4px solid #3498db; color: #333; }

/* Panel Representante */
.panel-rep { display: none; margin-top:10px; border: 2px solid var(--vinotinto-rep); border-radius: 8px; overflow: hidden; }
.panel-rep-header { background: var(--vinotinto-rep); color: white; padding: 10px 15px; font-size: 13px; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.panel-rep-body { padding: 15px; background: rgba(46, 139, 87, 0.03); }

/* Photos */
.photos-section { margin-top: 15px; }
.photos-grid { display: flex; gap: 30px; flex-wrap: wrap; }
.photo-box { text-align: center; padding: 15px; border: 2px dashed #ccc; border-radius: 10px; flex: 1; min-width: 200px; }
.photo-box-rep { border-color: var(--vinotinto-rep); }
.photo-preview-box { width: 100px; height: 100px; border: 2px solid #ddd; margin: 10px auto; border-radius: 8px; overflow: hidden; background: #f9f9f9; display: flex; align-items: center; justify-content: center; }
.photo-preview-box img { width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-hint { font-size: 10px; color: #666; margin-top: 5px; }

/* Carnets */
.carnets-section { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); padding: 25px; border-radius: 12px; border: 2px solid #dee2e6; margin-top: 20px; }
.carnets-header { text-align: center; margin-bottom: 20px; font-weight: 700; color: #555; font-size: 14px; }
.carnets-grid { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; align-items: flex-start; }

/* Carnet Card Design */
.carnet-card { 
    width: 340px; min-width: 300px;
    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%); 
    border: 2px solid var(--vinotinto); border-radius: 10px; overflow: hidden; 
    display: flex; flex-direction: column; position: relative; 
    box-shadow: 0 6px 20px rgba(128, 0, 32, 0.12); 
}
.carnet-card.representante { border-color: var(--vinotinto-rep); box-shadow: 0 6px 20px rgba(46, 139, 87, 0.12); }

.carnet-header { height: 40px; background: linear-gradient(90deg, var(--vinotinto), var(--vinotinto-dark)); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; flex-shrink: 0; }
.carnet-card.representante .carnet-header { background: linear-gradient(90deg, var(--vinotinto-rep), var(--vinotinto-rep-dark)); }
.carnet-logo { height: 28px; filter: brightness(0) invert(1); }
.carnet-municipio-header { color: #fff; font-size: 15px; font-weight: 800; text-transform: uppercase; background: rgba(0,0,0,0.3); padding: 3px 10px; border-radius: 12px; }

.carnet-body { flex: 1; display: flex; padding: 10px 12px 8px 12px; gap: 12px; align-items: flex-start; }
.carnet-photo { width: 80px; height: 80px; border: 2px solid var(--vinotinto); border-radius: 6px; overflow: hidden; background: #eee; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.carnet-card.representante .carnet-photo { border-color: var(--vinotinto-rep); }
.carnet-photo img { width: 100%; height: 100%; object-fit: cover; }

.carnet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-top: 2px; }
.carnet-name { font-size: 16px; font-weight: 800; color: #111; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carnet-talento { font-size: 16px; font-weight: 700; color: var(--vinotinto); text-transform: uppercase; }
.carnet-id-large { font-size: 14px; color: #333; font-weight: 700; font-family: 'Courier New', monospace; background: #f0f0f0; padding: 3px 10px; border-radius: 4px; display: inline-block; }

.carnet-body-rep { flex: 1; display: flex; padding: 10px 12px 6px 12px; gap: 12px; align-items: flex-start; }
.carnet-info-rep { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.carnet-name-rep { font-size: 16px; font-weight: 800; color: #111; line-height: 1.1; text-overflow: ellipsis; overflow: hidden; }
.carnet-parentesco-rep { font-size: 12px; font-weight: 700; color: var(--vinotinto-rep); text-transform: uppercase; }

.carnet-footer-compact { height: 55px; background: linear-gradient(to bottom, #f5f5f5, #ebebeb); border-top: 1px solid #ddd; display: flex; align-items: center; padding: 4px 8px; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.barcode-container { flex: 1; display: flex; align-items: center; justify-content: center; height: 48px; background: white; border-radius: 4px; border: 1px solid #e0e0e0; overflow: hidden; }
.qr-container { width: 60px; height: 60px; background: white; border-radius: 4px; border: 1px solid #e0e0e0; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }

/* Buttons */
.btn { 
    background: var(--vinotinto); color: white; border: none; 
    padding: 12px 30px; border-radius: 8px; font-weight: 700;
    cursor: pointer; transition: all 0.3s; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-family: inherit;
}
.btn:hover { background: var(--vinotinto-dark); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(128, 0, 32, 0.3); }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #5a6268; }
.btn-main { font-size: 16px; padding: 15px 40px; }
.btn-small { padding: 8px 20px; font-size: 12px; }
.btn-rep { background: var(--vinotinto-rep); }
.btn-rep:hover { background: var(--vinotinto-rep-dark); }

/* Messages */
.form-message { padding: 15px; border-radius: 8px; margin-top: 15px; font-size: 14px; display: none; }
.form-message.success { display: block; background: rgba(46, 139, 87, 0.1); border-left: 4px solid #2E8B57; color: #155724; }
.form-message.error { display: block; background: rgba(220, 53, 69, 0.1); border-left: 4px solid #DC3545; color: #721c24; }

/* Actions Bar */
.actions-bar { display: flex; justify-content: flex-end; gap: 15px; margin-top: 20px; padding-top: 20px; border-top: 2px solid #eee; }

/* Responsive Tablet/PC */
@media (min-width: 768px) {
    .form-grid { grid-template-columns: repeat(12, 1fr); gap: 8px; }
    .col-1{ grid-column: span 1; } .col-2{ grid-column: span 2; } .col-3{ grid-column: span 3; } 
    .col-4{ grid-column: span 4; } .col-5{ grid-column: span 5; } .col-6{ grid-column: span 6; } .col-12{ grid-column: span 12; }
    
    .header-text h1 { font-size: 24px; }
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .actions-bar { flex-direction: column; }
    .btn { width: 100%; }
    .photos-grid { flex-direction: column; align-items: center; }
    .photo-box { width: 100%; }
}