/* ===== PÁXINA ENVIAR — FORMULARIO POR PASOS ===== */

.page-enviar {
    overflow: hidden;
}

/* ===== STEPS ===== */
.step {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.step.hidden { display: none; }

/* ===== STEP HEADER ===== */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 16px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.step-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--accent);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 50%;
}

.step-back:hover { background: var(--gray-200); }

.step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
}

.step-count {
    font-size: 0.72rem;
    color: var(--gray-400);
    min-width: 32px;
    text-align: right;
}

/* ===== PASO 1: MAPA FULLSCREEN ===== */
.mapa-fullscreen {
    flex: 1;
    min-height: 0;
    margin: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    position: relative;
}

/* ===== TOAST (aviso emerxente) ===== */
.map-toast {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    z-index: 800;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
    max-width: calc(100% - 24px);
    text-align: center;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
    .map-toast {
        white-space: normal;
        max-width: min(420px, calc(100% - 24px));
    }
}

.map-toast.fade-out {
    opacity: 0;
}

.step-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
    gap: 12px;
}

.step-bottom-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.coords-text {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}

.coords-text.has-coords {
    color: var(--gray-800);
}

.btn-geo {
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.btn-geo:hover { text-decoration: underline; }

.btn-next {
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 24px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-next:hover { background: var(--accent-hover); }

.btn-next:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* ===== PASO 2: DETALLES ===== */
.step-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

/* ===== FIELDS ===== */
.field { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 5px;
}

.field-label-row .field-label {
    margin-bottom: 0;
}

.req { color: var(--accent); }
.opt { color: var(--gray-400); font-weight: 400; }

.field-hint {
    font-size: 0.68rem;
    color: var(--gray-400);
    margin-top: 5px;
}

.char-count {
    font-size: 0.68rem;
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}

.char-count.near-limit { color: #e65100; }
.char-count.at-limit { color: #d32f2f; }

/* ===== SELECT ===== */
.field-select {
    font-family: var(--font);
    width: 100%;
    padding: 9px 12px;
    font-size: 0.82rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.field-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

/* ===== UPLOAD ===== */
.upload {
    position: relative;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload:hover { border-color: var(--accent); }

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--gray-400);
    font-size: 0.75rem;
    padding: 14px;
}

.upload-preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.upload-preview.hidden { display: none; }

/* ===== INPUT + TEXTAREA ===== */
.field-input,
.field-textarea {
    font-family: var(--font);
    width: 100%;
    padding: 9px 12px;
    font-size: 0.82rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    resize: vertical;
}

.field-input:focus,
.field-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.field-textarea { line-height: 1.5; }

/* ===== CHECKBOX LEGAL ===== */
.field-check { margin-bottom: 14px; }

.check-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}

.check-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.check-label a {
    color: var(--accent);
    text-decoration: none;
}

.check-label a:hover { text-decoration: underline; }

.form-note {
    font-size: 0.65rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 10px;
    line-height: 1.5;
}

.form-note a {
    color: var(--gray-400);
    text-decoration: underline;
}

/* ===== SUBMIT ===== */
.btn-submit {
    font-family: var(--font);
    width: 100%;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-note {
    font-size: 0.65rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 8px;
}

/* ===== ERRO ===== */
.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    margin-top: 14px;
}

.form-error.hidden { display: none; }

/* ===== SUCCESS ===== */
.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    text-align: center;
}

.form-success h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-success p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.btn-secondary {
    font-family: var(--font);
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(0, 113, 227, 0.08);
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
}
