/* 
  TreeGlobal Survey MVP - Premium Styles
  Responsive & Mobile-first
*/

:root {
    --primary: #1a472a;
    /* Forest Green */
    --primary-light: #2ecc71;
    /* Emerald */
    --accent: #27ae60;
    --bg-light: #f8faf9;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --error: #e74c3c;
    --success: #27ae60;
    --border: #e0e6e0;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 100px;
    /* Space for sticky nav */
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 24px;
}

.request-id-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

p.guide-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.progress-bar-bg {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 25%;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Cards & Forms */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    background: #fdfdfd;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.error-msg {
    color: var(--error);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
    display: none;
}

.has-error input {
    border-color: var(--error);
}

.has-error .error-msg {
    display: block;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Radio & Checkbox Custom */
.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.option-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.option-card input {
    position: absolute;
    opacity: 0;
}

.option-card:has(input:checked) {
    border-color: var(--primary-light);
    background: var(--bg-light);
    color: var(--primary);
}

/* MAPA AUTOCOMPLETE */

.leaflet-pane {
    z-index: 1 !important;
}

.leaflet-top,
.leaflet-bottom {
    z-index: 1 !important;
}

.autocomplete-results {
    position: absolute;
    background: white;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
    margin-top: 5px;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.autocomplete-item:hover {
    background: #f3f4f6;
}

/* Service Selection */
.service-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
}

.service-item.selected {
    border-color: var(--primary-light);
    background: var(--bg-light);
}

.counter-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-circle:active {
    background: var(--primary);
    color: white;
}

.counter-value {
    font-weight: 700;
    font-size: 1.2rem;
    min-width: 25px;
    text-align: center;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab {
    padding: 8px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Photo Upload */
.photo-upload-container {
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: var(--transition);
}

.photo-upload-container.has-preview {
    border-style: solid;
    padding: 10px;
}

.preview-img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    display: none;
}

.photo-upload-container.has-preview .preview-img {
    display: block;
}

.photo-upload-container.has-preview .upload-placeholder {
    display: none;
}

.upload-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* Chips */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    padding: 6px 14px;
    background: #f1f3f5;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.chip:hover {
    background: #e9ecef;
}

.chip.selected {
    background: var(--bg-light);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Footer Navigation */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.btn {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-secondary {
    background: #e9ecef;
    color: var(--text-main);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 90%;
    width: 400px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
}

/* Summary Styles */
.summary-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.summary-item {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.summary-label {
    color: var(--text-muted);
}

.edit-link {
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.tree-summary-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Glossary Icon */
.glossary-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}



/* --- FOTOS DE ARBOLES --- */

.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-preview-item {
    width: 90px;
    height: 90px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #f5f5f5;
}


.photo-preview-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.photo-preview-item .btn-circle {
    position: absolute;
    top: 5px;
    right: 5px;
    background: white;
}