* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #003d82 0%, #0066cc 100%);
    color: #333;
    min-height: 100vh;
    padding-bottom: 120px;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    padding: 0 16px;
}

/* Pantallas */
.screen {
    display: none;
    min-height: 100vh;
    padding-top: 20px;
    animation: slideIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    text-align: center;
    color: white;
    padding: 40px 20px 60px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><defs><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23003d82"/><stop offset="100%" style="stop-color:%230066cc"/></linearGradient></defs><rect fill="url(%23grad)" width="1200" height="600"/></svg>') center/cover;
}

.header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 18px;
    font-weight: 300;
    opacity: 0.95;
}

.screen-header {
    display: flex;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.back-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    color: #003d82;
    transition: transform 0.2s;
}

.back-btn:active {
    transform: scale(0.9);
}

.screen-header h2 {
    color: #003d82;
    font-size: 24px;
}

/* Menu */
.menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 16px;
}

.menu-btn {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 150px;
}

.menu-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.menu-icon {
    font-size: 48px;
}

.menu-text {
    font-size: 16px;
    font-weight: 600;
    color: #003d82;
}

/* Formulario */
.survey-form {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #003d82;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0066cc;
    background: #f0f7ff;
}

/* Fieldset Educación */
.education-group {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.education-group legend {
    color: #003d82;
    font-weight: 700;
    padding: 0 8px;
}

.education-group .form-group {
    margin-bottom: 16px;
}

/* GPS Section */
.gps-section {
    background: #f0f7ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid #0066cc;
}

.gps-status {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.gps-progress {
    background: white;
    padding: 16px;
    border-radius: 6px;
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #003d82);
    width: 0%;
    transition: width 0.1s linear;
}

#gpsCountdown {
    text-align: center;
    color: #003d82;
    font-weight: 600;
    margin: 0;
}

.gps-coords {
    background: white;
    padding: 16px;
    border-radius: 6px;
    margin-top: 12px;
    border: 2px solid #4caf50;
}

.gps-coords p {
    margin: 8px 0;
    font-size: 14px;
    color: #333;
}

.gps-coords span {
    font-weight: 600;
    color: #003d82;
}

/* Botones */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc, #003d82);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #e0e0e0;
    color: #003d82;
}

.btn-secondary:active {
    background: #d0d0d0;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions .btn {
    flex: 1;
}

/* Survey List */
.survey-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.survey-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0066cc;
}

.survey-item h3 {
    color: #003d82;
    font-size: 18px;
    margin-bottom: 12px;
}

.survey-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.survey-info-row {
    background: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
}

.survey-info-row strong {
    color: #003d82;
}

.survey-education {
    background: #f0f7ff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.survey-education h4 {
    color: #003d82;
    margin-bottom: 8px;
    font-size: 14px;
}

.survey-location {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}

.survey-location strong {
    color: #003d82;
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: white;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* FAB Install Button */
.fab-install {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    padding: 0;
}

.fab-install:active {
    transform: scale(0.9);
}

.fab-install[style*="display: flex"] {
    visibility: visible !important;
    opacity: 1 !important;
}

.install-icon {
    font-size: 28px;
}

.install-text {
    font-size: 11px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(76, 175, 80, 0.6);
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 280px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-bottom: 140px;
    }

    .fab-install {
        bottom: 20px;
        right: 16px;
        width: 70px;
        height: 70px;
        font-size: 12px;
    }

    .install-icon {
        font-size: 24px;
    }

    .install-text {
        font-size: 8px;
        line-height: 1;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 150px;
    }

    .header h1 {
        font-size: 36px;
    }

    .screen-header {
        padding: 16px;
    }

    .survey-form {
        padding: 16px;
    }

    .survey-info {
        grid-template-columns: 1fr;
    }

    /* FAB responsivo para móviles */
    .fab-install {
        bottom: 18px;
        right: 12px;
        width: 65px;
        height: 65px;
        font-size: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .install-icon {
        font-size: 22px;
    }

    .install-text {
        font-size: 7px;
        line-height: 1;
    }
}

@media (max-width: 360px) {
    body {
        padding-bottom: 140px;
    }

    .fab-install {
        bottom: 16px;
        right: 10px;
        width: 60px;
        height: 60px;
        font-size: 9px;
    }

    .install-icon {
        font-size: 20px;
    }

    .install-text {
        font-size: 6px;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #001a4d 0%, #003366 100%);
    }

    .survey-form,
    .survey-item,
    .form-group input,
    .form-group select,
    .progress-bar,
    .gps-progress,
    .gps-coords,
    .screen-header {
        background: #222;
        color: #e0e0e0;
        border-color: #444;
    }

    .form-group label,
    .education-group legend,
    .back-btn,
    .screen-header h2 {
        color: #66e0ff;
    }

    .form-group input:focus,
    .form-group select:focus {
        background: #1a3a52;
        border-color: #66e0ff;
    }

    .survey-info-row,
    .survey-education,
    .survey-location {
        background: #333;
        color: #e0e0e0;
    }

    .empty-message {
        background: rgba(0, 0, 0, 0.3);
        color: #e0e0e0;
    }
}
