/* ============================================================
   BIOAUREA - Modals & Forms
   All modal styles, form inputs, auth forms
   ============================================================ */

/* ===== Base Modals ===== */
.modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); z-index: 10000; overflow-y: auto; padding: 20px;
}
.modal.active { display: flex; align-items: flex-start; justify-content: center; padding-top: 110px; }

.modal-content {
    background: var(--bg-card); max-width: 480px; width: 100%;
    border-radius: 16px; border: 1px solid rgba(0,255,136,0.2);
    box-shadow: 0 20px 60px rgba(0,0,0,0.9); position: relative; padding: 24px;
}

.modal-header {
    padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}

.modal-title { font-size: 1.3em; color: var(--green-primary); font-weight: 700; }
.modal-close { width: 28px; height: 28px; cursor: pointer; stroke: var(--text-secondary); transition: all 0.3s; }
.modal-close:hover { stroke: var(--green-primary); transform: rotate(90deg); }

/* ===== Form Elements ===== */
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-label { display: block; color: var(--text-secondary); font-size: 0.82em; margin-bottom: 5px; font-weight: 600; }

.form-input {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(0,255,136,0.3);
    border-radius: 8px; color: var(--text-primary); font-size: 0.9em; transition: all 0.3s;
}

.form-input:focus { outline: none; border-color: var(--green-primary); box-shadow: 0 0 10px rgba(0,255,136,0.15); }

/* ===== Phone Input ===== */
.phone-input-wrapper {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.phone-code-select {
    width: 100px !important;
    flex-shrink: 0;
    padding: 9px 6px !important;
    font-size: 0.85em !important;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
}
.phone-number-input {
    flex: 1;
    min-width: 0;
}

/* ===== Auth Styles ===== */
.auth-tabs { display: flex; gap: 0; margin-bottom: 14px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,255,136,0.3); }
.auth-tab { flex: 1; padding: 10px; text-align: center; cursor: pointer; background: transparent; color: #888; font-weight: 600; transition: all 0.3s; border: none; font-size: 0.88em; }
.auth-tab.active { background: rgba(0,255,136,0.15); color: #00ff88; }
.auth-tab:hover:not(.active) { background: rgba(255,255,255,0.05); color: #fff; }
.auth-form-section { display: none; }
.auth-form-section.active { display: block; }
.form-error { color: #ff4444; font-size: 0.85em; margin-top: 8px; min-height: 20px; display: none; }
.form-error.show { display: block; }
.auth-error { color: #ff4444; font-size: 0.85em; margin-top: 5px; display: none; }
.auth-error.show { display: block; }

/* ===== Auth Divider ===== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 14px 0;
    gap: 10px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}
.auth-divider span {
    color: #666;
    font-size: 0.85em;
    white-space: nowrap;
}

/* ===== Google Button ===== */
.btn-google {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}
.btn-google:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ===== Informe Modal ===== */
.modal-informe {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); z-index: 10002; overflow-y: auto; padding: 20px;
}
.modal-informe.active { display: block; }

.modal-informe-content {
    background: #111111; max-width: 660px; margin: 20px auto 40px;
    border-radius: 16px; border: 1px solid rgba(0,255,136,0.15);
    box-shadow: 0 20px 80px rgba(0,0,0,0.95), 0 0 40px rgba(0,255,136,0.05);
    position: relative; overflow: hidden;
}

.modal-informe-header {
    background: linear-gradient(135deg, #0d1f14 0%, #111111 50%, #1a1209 100%);
    padding: 18px 24px; border-radius: 16px 16px 0 0;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(0,255,136,0.1); position: relative; overflow: hidden;
}

.modal-informe-header::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #00ff88, #00cc6a, #ffd700, #00ff88);
    background-size: 200% 100%;
    animation: shimmer-header 3s linear infinite;
}

.modal-informe-title {
    font-size: 1.1em; color: #ffffff; font-weight: 700; margin: 0; letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #00ff88 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.modal-informe-close {
    width: 30px; height: 30px; cursor: pointer; stroke: #666; transition: all 0.3s;
    background: rgba(255,255,255,0.05); border-radius: 8px; padding: 5px; flex-shrink: 0;
}
.modal-informe-close:hover { background: rgba(255,68,68,0.15); stroke: #ff4444; transform: rotate(90deg); }

.modal-informe-body { padding: 18px 24px 28px; max-height: 82vh; overflow-y: auto; }
.modal-informe-body::-webkit-scrollbar { width: 6px; }
.modal-informe-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 10px; }
.modal-informe-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.modal-informe-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.informe-section { margin: 14px 0; }
.informe-section-title { color: #ffffff; font-size: 0.88em; margin-bottom: 10px; border-left: 3px solid rgba(255,255,255,0.2); padding-left: 9px; font-weight: 600; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.info-box { background: rgba(255,255,255,0.03); padding: 10px 12px; border-radius: 7px; border-left: 2px solid rgba(255,255,255,0.1); }
.info-box-label { color: #888; font-size: 0.75em; margin-bottom: 3px; }
.info-box-value { color: #ffffff; font-size: 0.92em; font-weight: 600; }

.highlight-box { background: rgba(255,255,255,0.05); padding: 12px; border-radius: 8px; text-align: center; margin-top: 10px; border: 1px solid rgba(255,255,255,0.05); }
.highlight-value { color: white; font-size: 1.35em; font-weight: 700; }

/* ===== Loading Spinner ===== */
.loading {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9); z-index: 20000;
    align-items: center; justify-content: center; flex-direction: column;
}
.loading.active { display: flex; }

.spinner {
    width: 60px; height: 60px;
    border: 4px solid rgba(0,255,136,0.2); border-top-color: var(--green-primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px;
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed; bottom: 30px; right: 30px;
    background: #1a1a1a; border: 2px solid #00ff88;
    padding: 18px 24px; border-radius: 12px;
    display: flex; align-items: center; gap: 15px;
    opacity: 0; transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10003;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    min-width: 300px; max-width: 400px;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: #00ff88; background: linear-gradient(135deg, #1a1a1a, #1a4d2e); }
.toast.error { border-color: #ff4444; background: linear-gradient(135deg, #1a1a1a, #4d1a1a); }
.toast.info { border-color: #00aaff; background: linear-gradient(135deg, #1a1a1a, #1a2a4d); }

.toast-icon { font-size: 24px; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 1em; margin-bottom: 4px; color: #ffffff; }
.toast-message { font-size: 0.9em; color: #b0b0b0; line-height: 1.4; }
.toast-close { cursor: pointer; font-size: 20px; color: #888; flex-shrink: 0; transition: color 0.3s; }
.toast-close:hover { color: #ffffff; }

/* ===== Coordinates Search Modal ===== */
.coord-modal-content {
    background: #0d0d0d;
    max-width: 400px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(0,255,136,0.15);
    box-shadow: 0 24px 80px rgba(0,0,0,0.95), 0 0 30px rgba(0,255,136,0.04);
    overflow: hidden;
    animation: coordModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes coordModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.coord-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0d1f14 0%, #0d0d0d 60%);
    border-bottom: 1px solid rgba(0,255,136,0.1);
    position: relative;
}
.coord-modal-header::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, #00ff88, #00cc6a, #ffd700, #00ff88);
    background-size: 200% 100%;
    animation: shimmer-header 3s linear infinite;
}

.coord-modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.coord-modal-icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,255,136,0.1);
    border-radius: 8px;
    stroke: #00ff88;
    flex-shrink: 0;
}
.coord-modal-title {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #00ff88 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.coord-modal-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    cursor: pointer;
    stroke: #666;
    transition: all 0.2s;
    flex-shrink: 0;
}
.coord-modal-close:hover {
    background: rgba(255,68,68,0.12);
    border-color: rgba(255,68,68,0.25);
    stroke: #ff5555;
    transform: rotate(90deg);
}

.coord-modal-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Range box */
.coord-range-box {
    padding: 10px 12px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}
.coord-range-label {
    color: #555;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 7px;
}
.coord-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.coord-range-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.coord-range-key {
    color: #555;
    font-size: 0.68em;
    font-weight: 600;
    text-transform: uppercase;
}
.coord-range-val {
    color: #bbb;
    font-size: 0.8em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Input section */
.coord-input-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.coord-section-label {
    color: #888;
    font-size: 0.76em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.coord-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.coord-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.coord-field-label {
    color: #666;
    font-size: 0.72em;
    font-weight: 600;
}
.coord-field-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0,255,136,0.18);
    border-radius: 7px;
    color: #e0e0e0;
    font-size: 0.82em;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}
.coord-field-input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 12px rgba(0,255,136,0.12);
    background: rgba(0,255,136,0.04);
}
.coord-field-input::placeholder {
    color: #444;
}

/* Error */
.coord-error {
    display: none;
    padding: 8px 12px;
    background: rgba(255,68,68,0.07);
    border: 1px solid rgba(255,68,68,0.18);
    border-radius: 7px;
    color: #ff6666;
    font-size: 0.8em;
    line-height: 1.4;
}

/* Submit button */
.coord-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(0,255,136,0.12), rgba(0,204,106,0.08));
    border: 1px solid rgba(0,255,136,0.3);
    border-radius: 9px;
    color: #00ff88;
    font-size: 0.85em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
    stroke: #00ff88;
}
.coord-submit-btn:hover {
    background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,204,106,0.14));
    border-color: rgba(0,255,136,0.5);
    box-shadow: 0 4px 20px rgba(0,255,136,0.15);
    transform: translateY(-1px);
}
.coord-submit-btn:active {
    transform: translateY(0);
}

/* Polygon CTA */
.coord-polygon-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
}
.coord-polygon-text {
    color: #555;
    font-size: 0.74em;
    line-height: 1.4;
    flex: 1;
}
.coord-polygon-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #777;
    font-size: 0.74em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    stroke: currentColor;
}
.coord-polygon-btn:hover {
    background: rgba(0,255,136,0.06);
    border-color: rgba(0,255,136,0.2);
    color: #00e07a;
}

/* Responsive */
@media (max-width: 480px) {
    .coord-modal-content { max-width: calc(100vw - 32px); margin: 0 16px; }
    .coord-input-row { grid-template-columns: 1fr 1fr; }
    .coord-input-row .coord-field:last-child { grid-column: 1 / -1; }
    .coord-modal-body { padding: 14px 14px 18px; }
}
