/**
 * MAP Style - Registration Card
 */

:root {
    --map-primary: #1e3a5f;
    --map-success: #2ecc71;
    --map-success-dark: #1a7f4b;
    --map-danger: #b42318;
    --map-danger-bg: #fde8e8;
    --map-success-bg: #e7f8ef;
    --map-bg: #f4f7f6;
    --map-text: #253444;
    --map-muted-text: #5f7078;
    --map-soft-text: #6f7f86;
    --map-placeholder: #8b98a8;
    --map-border: #d6dde6;
    --map-border-soft: #d7e0ea;
    --map-surface-soft: #f8fbff;
    --map-shadow-soft: 0 10px 28px rgba(31,54,78,0.05);
}

/* 1. The Main Card */
.map-registration-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 30px;
    max-width: 600px;
    margin: 40px auto;
    transition: transform 0.3s ease;
    /* Keeps the dropdown list visible when it leaves the card */
    overflow: visible !important;
}

.map-step-header {
    margin-bottom: 25px;
    border-bottom: 2px solid var(--map-bg);
    padding-bottom: 15px;
}

.map-step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.map-indicator-dot {
    height: 10px;
    flex: 1;
    margin: 0 5px;
    background: var(--map-border);
    border-radius: 5px;
    transition: background 0.4s ease;
}

.map-indicator-dot.active {
    background: var(--map-primary);
}

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

.map-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--map-muted-text);
}

/* INTEGRATED FIX: Handles vertical breathing room and fixed-height issues */
.map-form-group input, 
.map-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--map-border);
    border-radius: 6px;
    font-size: 15px;
    height: auto; 
    line-height: 1.5;
    color: var(--map-text);
}

.map-form-group textarea {
    color: var(--map-text);
    border-color: var(--map-border);
}

.map-form-group input::placeholder,
.map-form-group textarea::placeholder {
    color: var(--map-placeholder);
    opacity: 1;
}

.map-uppercase-name {
    text-transform: uppercase;
}

.map-agency-suggestions {
    display: none;
    position: absolute;
    z-index: 999;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--map-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(20,48,80,0.14);
    padding: 6px;
}

.map-agency-suggestion {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--map-text);
    cursor: pointer;
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    padding: 9px 10px;
    text-align: left;
    border-radius: 6px;
}

.map-agency-suggestion:hover,
.map-agency-suggestion:focus {
    background: #eef7fd;
    color: var(--map-primary);
    outline: none;
}

.map-agency-suggestion-empty {
    color: var(--map-soft-text);
    font-size: 12px;
    padding: 8px 10px;
}

.map-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* 2. Button Styling (Preserved) */
.map-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.map-btn-next { background: var(--map-primary); color: #fff; }
.map-btn-prev { background: var(--map-bg); color: var(--map-text); }
.map-btn-submit { background: var(--map-success); color: #fff; }

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

.map-auth-toggle-wrap {
    display: inline-flex;
    align-items: center;
}

.map-auth-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 28px;
    border: 0;
    border-radius: 6px;
    background: var(--map-primary);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 10px 20px rgba(30, 58, 95, 0.14);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.map-auth-toggle-btn:hover,
.map-auth-toggle-btn:focus {
    background: #244a78;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(30, 58, 95, 0.18);
}

.map-auth-toggle-btn:active {
    transform: translateY(0);
}

.card-hidden { display: none; }

/* 3. Modern File Upload Styling */
.map-file-upload-container {
    position: relative;
    border: 2px dashed var(--map-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
    background: var(--map-bg);
}

.map-file-upload-container:hover {
    border-color: var(--map-primary);
}

.map-file-upload-container.is-dragging {
    border-color: var(--map-primary);
    background: #eef7fd;
}

.map-file-upload-container input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.map-upload-icon {
    width: 28px;
    height: 28px;
    border: 2px solid var(--map-primary);
    border-radius: 6px;
    margin: 0 auto 10px;
    display: block;
    position: relative;
}

.map-upload-icon::before,
.map-upload-icon::after {
    content: "";
    position: absolute;
    background: var(--map-primary);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.map-upload-icon::before {
    width: 12px;
    height: 2px;
}

.map-upload-icon::after {
    width: 2px;
    height: 12px;
}

.map-file-label {
    display: block;
    font-size: 14px;
    color: var(--map-text);
}

.file-selected {
    border-color: var(--map-success) !important;
    background: #eafaf1;
}

/* 4. Chrome Hierarchy Fix (Preserved to ensure dropdown clears column edges) */
.elementor-widget-map_registration, 
.elementor-widget-container,
.map-step-card {
    overflow: visible !important;
}

/* Shared public request forms: CTOS and Land Search */
body.map-ctos-standalone,
body.map-land-standalone {
    margin: 0;
    background: #fff;
    font-family: Inter, Arial, sans-serif;
    color: var(--map-text);
}

body.map-ctos-standalone #wpadminbar,
body.map-land-standalone #wpadminbar {
    display: none !important;
}

.map-ctos-public,
.map-public-request {
    max-width: 980px;
    margin: 34px auto 48px;
    padding: 0 18px;
    color: var(--map-text);
    font-size: 14px;
    line-height: 1.55;
}

.map-ctos-public *,
.map-public-request * {
    box-sizing: border-box;
}

.map-ctos-intro,
.map-public-intro {
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e4ebf2;
}

.map-ctos-title,
.map-public-title {
    margin: 0 0 6px;
    color: var(--map-primary);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.map-ctos-subtitle,
.map-public-subtitle {
    margin: 0;
    color: var(--map-muted-text);
    font-size: 14px;
}

.map-ctos-card,
.map-public-card {
    background: #fff;
    border: 1px solid var(--map-border-soft);
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--map-shadow-soft);
}

.map-public-honeypot {
    height: 0 !important;
    left: -9999px !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: auto !important;
    width: 1px !important;
}

.map-ctos-section-title,
.map-public-section-title {
    margin: 0 0 16px;
    color: var(--map-primary);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.map-ctos-agent-card,
.map-public-agent-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    background: var(--map-surface-soft);
    border: 1px solid var(--map-border-soft);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 18px;
    box-shadow: var(--map-shadow-soft);
}

.map-ctos-agent-photo,
.map-public-agent-photo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: hidden;
    background: #eaf2fb;
    border: 1px solid #d7e5f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--map-primary);
    font-size: 22px;
    font-weight: 800;
    flex: 0 0 auto;
}

.map-ctos-agent-photo img,
.map-public-agent-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-ctos-agent-eyebrow,
.map-public-agent-eyebrow {
    margin: 0 0 3px;
    color: var(--map-success-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.map-ctos-agent-name,
.map-public-agent-name {
    margin: 0;
    color: var(--map-primary);
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
}

.map-ctos-agent-meta,
.map-public-agent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 8px;
    color: var(--map-muted-text);
    font-size: 13px;
}

.map-ctos-agent-note,
.map-public-agent-note {
    margin: 10px 0 0 !important;
    color: var(--map-text) !important;
    font-size: 14px !important;
    font-weight: 700;
}

.map-ctos-grid,
.map-public-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.map-ctos-public p,
.map-public-request p {
    margin: 0 0 16px;
}

.map-ctos-public label,
.map-public-request label {
    align-items: center;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
    justify-content: flex-start;
    text-transform: uppercase;
    color: var(--map-muted-text);
    margin-bottom: 7px;
    letter-spacing: 0;
}

.map-land-info-wrap {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    line-height: 1;
    position: relative;
}

.map-public-request .map-land-info-button,
.map-ctos-public .map-land-info-button {
    align-items: center !important;
    appearance: none !important;
    background: #fff !important;
    border: 2px solid #0b82ff !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    color: #0b82ff !important;
    cursor: help !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    height: 18px !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    text-transform: none !important;
    width: 18px !important;
}

.map-public-request .map-land-info-button:hover,
.map-public-request .map-land-info-button:focus,
.map-ctos-public .map-land-info-button:hover,
.map-ctos-public .map-land-info-button:focus {
    background: #eaf4ff !important;
    outline: none !important;
}

.map-land-info-popover {
    background: #fff;
    border: 1px solid var(--map-border-soft);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 28, 42, 0.22);
    left: 50%;
    max-width: min(780px, calc(100vw - 70px));
    opacity: 0;
    padding: 8px;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(-4px) scale(0.98);
    transition: opacity 0.15s ease, transform 0.15s ease;
    visibility: hidden;
    width: max-content;
    z-index: 50;
}

.map-land-info-popover::before {
    background: #fff;
    border-left: 1px solid var(--map-border-soft);
    border-top: 1px solid var(--map-border-soft);
    content: "";
    height: 10px;
    left: 50%;
    position: absolute;
    top: -6px;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
}

.map-land-info-popover img {
    display: block;
    height: auto;
    max-height: min(560px, calc(100vh - 90px));
    max-width: min(760px, calc(100vw - 90px));
    width: auto;
}

.map-land-info-wrap:hover .map-land-info-popover,
.map-land-info-wrap:focus-within .map-land-info-popover {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    visibility: visible;
}

.map-ctos-public input,
.map-ctos-public select,
.map-public-request input,
.map-public-request select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #ccd6e2;
    border-radius: 7px;
    padding: 11px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--map-text);
    background: #fff;
    box-shadow: 0 2px 8px rgba(31,54,78,0.04);
}

.map-ctos-uppercase,
.map-public-uppercase {
    text-transform: uppercase;
}

.map-ctos-help,
.map-public-help {
    display: block;
    margin-top: 6px;
    color: var(--map-muted-text);
    font-size: 12px;
    line-height: 1.4;
}

.map-ctos-public input[type="radio"],
.map-ctos-public input[type="checkbox"],
.map-public-request input[type="radio"],
.map-public-request input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    box-shadow: none;
}

.map-ctos-option,
.map-public-option {
    display: grid !important;
    align-items: start !important;
    grid-template-columns: auto 1fr;
    gap: 10px;
    height: 100%;
    border: 1px solid var(--map-border-soft);
    border-radius: 8px;
    padding: 14px;
    background: var(--map-surface-soft);
    color: var(--map-text);
    cursor: pointer;
    text-transform: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.map-ctos-option input,
.map-public-option input {
    flex: 0 0 auto;
    margin: 2px 0 0 !important;
    padding: 0 !important;
}

.map-ctos-option > span,
.map-public-option > span {
    margin-top: 0 !important;
    min-width: 0;
}

.map-ctos-option strong,
.map-public-option strong {
    color: var(--map-primary);
    font-size: 14px;
    font-weight: 800;
}

.map-ctos-option span,
.map-public-option span {
    display: block;
    color: var(--map-muted-text);
    font-size: 13px;
    margin-top: 2px;
}

.map-ctos-price,
.map-public-price {
    display: inline-block;
    margin-top: 7px;
    color: var(--map-primary);
    font-size: 13px;
    font-weight: 800;
}

.map-ctos-public button,
.map-ctos-button,
.map-public-request button,
.map-public-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    background: var(--map-primary);
    color: #fff;
    border: 0;
    border-radius: 7px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.map-ctos-public button:hover,
.map-ctos-button:hover,
.map-public-request button:hover,
.map-public-button:hover {
    background: var(--portal-hover, #2b5080);
    color: #fff;
}

.map-ctos-public button:disabled,
.map-ctos-button:disabled,
.map-public-request button:disabled,
.map-public-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.map-ctos-card > .map-public-button,
.map-public-card > .map-public-button {
    margin-top: 18px;
    min-width: 150px;
}

.map-ctos-secondary,
.map-public-secondary {
    background: #eef3f8 !important;
    color: var(--map-primary) !important;
}

.map-ctos-signature {
    border: 1px dashed #9fb4c8;
    border-radius: 8px;
    width: 100%;
    height: 150px;
    background: #fff;
    touch-action: none;
}

.map-ctos-consent,
.map-public-consent {
    box-shadow: none;
    background: #fbfdff;
}

.map-ctos-consent-text,
.map-public-consent-text {
    color: var(--map-muted-text);
    font-size: 14px;
}

.map-ctos-consent-label,
.map-public-consent-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    text-transform: none !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--map-text) !important;
    margin-top: 12px !important;
    letter-spacing: 0 !important;
}

.map-ctos-alert,
.map-public-alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
}

.map-ctos-error,
.map-public-error {
    background: var(--map-danger-bg);
    color: var(--map-danger);
}

.map-ctos-success,
.map-public-success {
    background: var(--map-success-bg);
    color: #177245;
}

@media (max-width: 720px) {
    .map-ctos-public,
    .map-public-request {
        margin: 24px auto 36px;
    }

    .map-ctos-title,
    .map-public-title {
        font-size: 26px;
    }

    .map-ctos-grid,
    .map-public-grid {
        grid-template-columns: 1fr;
    }

    .map-ctos-card,
    .map-public-card {
        padding: 18px;
    }

    .map-ctos-agent-card,
    .map-public-agent-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .map-ctos-agent-photo,
    .map-public-agent-photo {
        margin: 0 auto;
    }

    .map-ctos-agent-meta,
    .map-public-agent-meta {
        justify-content: center;
    }
}
