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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, rgb(210, 56, 49) 0%, #8b1a1a 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: white;
}

.header-logo {
    height: 120px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-center {
    justify-content: center;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgb(210, 56, 49);
}

.user-details {
    color: white;
}

.user-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.user-email {
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
    min-height: 44px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    text-align: center;
}

.btn i {
    margin-right: 6px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 32px;
}

.btn-primary {
    background: #fff;
    color: rgb(210, 56, 49);
}

.btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.auth-status {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.auth-status.authenticated {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.auth-status.not-authenticated {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.status-badge.enabled {
    background: #d4edda;
    color: #155724;
}

.status-badge.disabled {
    background: #f8d7da;
    color: #721c24;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

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

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

.survey-public {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.survey-public-title {
    color: rgb(210, 56, 49);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.survey-rut-form .form-group {
    margin-bottom: 1rem;
}

.survey-rut-form .form-input,
.survey-rut-form input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.survey-rut-form .form-input:focus,
.survey-rut-form input[type="text"]:focus {
    outline: none;
    border-color: rgb(210, 56, 49);
    box-shadow: 0 0 0 2px rgba(210, 56, 49, 0.2);
}

.survey-rut-form .form-submit-wrap {
    text-align: center;
    margin-top: 1.25rem;
}

.survey-rut-form .btn-enviar {
    background: rgb(210, 56, 49);
    color: white;
    border: none;
}

.survey-rut-form .btn-enviar:hover {
    background: #8b1a1a;
    color: white;
}

.survey-rut-form .form-error {
    display: block;
    color: #721c24;
    font-size: 0.9rem;
    margin-top: 6px;
}

.survey-result {
    margin-bottom: 1.5rem;
}

.modal-body-qr {
    text-align: center;
}

.qr-image {
    display: block;
    margin: 0 auto 1rem;
    max-width: 100%;
    height: auto;
}

.qr-download-btn {
    margin-top: 0.5rem;
}

.footer {
    text-align: center;
    padding: 20px;
    color: white;
    opacity: 0.8;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.modal-title {
    color: rgb(210, 56, 49);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: rgb(210, 56, 49);
}

.modal-body {
    margin-bottom: 25px;
}

.modal-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-confirm {
    background: rgb(210, 56, 49);
    color: white;
}

.btn-confirm:hover {
    background: #8b1a1a;
}

.surveys-section {
    margin-top: 0;
}

.surveys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
}

.surveys-header h2 {
    color: rgb(210, 56, 49);
    font-size: 1.5rem;
    margin: 0;
}

.survey-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.survey-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid rgb(210, 56, 49);
    margin-bottom: 12px;
}

.survey-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.survey-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.survey-name {
    font-weight: 600;
    color: #333;
    font-size: 1.05rem;
}

.survey-info .status-badge-sm {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.survey-url,
.survey-drive-url {
    font-size: 0.85rem;
    color: #17a2b8;
    text-decoration: none;
    word-break: break-all;
}

.survey-url:hover,
.survey-drive-url:hover {
    text-decoration: underline;
}

.survey-url-empty {
    font-size: 0.85rem;
    color: #6c757d;
}

.survey-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.survey-actions .survey-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.survey-actions .btn {
    white-space: nowrap;
}

.survey-list-empty {
    text-align: center;
    color: #666;
    padding: 32px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px dashed #dee2e6;
}

.survey-form .form-group {
    margin-bottom: 18px;
}

.survey-form .form-group:last-of-type {
    margin-bottom: 24px;
}

.survey-form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.survey-form input[type="text"],
.survey-form input[type="url"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
}

.survey-form input:focus {
    outline: none;
    border-color: rgb(210, 56, 49);
    box-shadow: 0 0 0 2px rgba(210, 56, 49, 0.2);
}

.survey-form .form-group-checkbox {
    margin-bottom: 18px;
}

.survey-form .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.survey-form .checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-group-description {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.survey-form .form-inline-error {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .auth-section {
        flex-direction: column;
    }

    .main-content {
        padding: 20px;
    }

    .surveys-header {
        flex-direction: column;
        align-items: stretch;
    }

    .survey-item {
        flex-direction: column;
        align-items: stretch;
    }

    .survey-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
