/* ---------------------------------------------------------------------------
 * terrain.css — Styles du mode terrain (V4.0)
 * Mobile-first, contrastes élevés, gros boutons.
 * --------------------------------------------------------------------------- */

.terrain {
    max-width: 640px;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.terrain__etape {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.terrain__label {
    font-weight: 600;
    color: #2f6b3a;
    font-size: 1rem;
}

/* Photo */
.terrain__photo-zone {
    position: relative;
    background: #f7f4ec;
    border: 2px dashed #c8d8cc;
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}

.terrain__photo-zone:hover {
    border-color: #2f6b3a;
    background: #f0f8f2;
}

.terrain__photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #888;
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
    pointer-events: none;
}

.terrain__photo-icon {
    font-size: 3rem;
    line-height: 1;
}

#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* GPS */
.terrain__gps {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.terrain__gps-info {
    font-size: 0.85rem;
    color: #888;
    font-family: ui-monospace, monospace;
}

/* Select & textarea */
.terrain__select,
.terrain__textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

.terrain__textarea {
    resize: vertical;
    min-height: 100px;
}

.terrain__counter {
    font-size: 0.75rem;
    color: #999;
    text-align: right;
}

/* Boutons */
.terrain__actions {
    display: flex;
    gap: 0.75rem;
}

.terrain__btn,
.terrain__btn-secondaire {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    min-height: 48px;
    transition: opacity 0.15s, background 0.15s;
    font-family: inherit;
}

.terrain__btn--primary {
    background: #2f6b3a;
    color: #fff;
    flex: 1;
    font-size: 1.05rem;
}

.terrain__btn--primary:hover:not(:disabled) {
    opacity: 0.9;
}

.terrain__btn--primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.terrain__btn-secondaire {
    background: #f0f4f0;
    color: #2f6b3a;
    border: 1px solid #c8d8cc;
}

.terrain__btn-secondaire:hover:not(:disabled) {
    background: #e0efe4;
}

/* Messages */
.terrain__message {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.terrain__message--erreur {
    background: #fdf0f0;
    border-left: 4px solid #c00;
    color: #800;
}

.terrain__message--info {
    background: #f0f8ff;
    border-left: 4px solid #08a;
    color: #046;
}

/* Confirmation */
.terrain__confirmation {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.terrain__confirmation-inner {
    max-width: 480px;
    text-align: center;
    padding: 2rem 1.5rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.terrain__confirmation-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.terrain__confirmation h2 {
    color: #2f6b3a;
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
}

.terrain__confirmation p {
    color: #555;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.terrain__confirmation-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Mobile */
@media (max-width: 520px) {
    .terrain__photo-zone {
        aspect-ratio: 1 / 1;
    }
    .terrain__actions {
        flex-direction: column;
    }
    .terrain__btn--primary {
        width: 100%;
    }
}