@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

/*
 * Homstir V2 shared visual language. Presentation only.
 */
:root {
    --v2-primary: #1164ef;
    --v2-primary-hover: #0c53cc;
    --v2-ink: #142849;
    --v2-muted: #687b98;
    --v2-canvas: #f4f7fc;
    --v2-surface: #fff;
    --v2-border: #dce5f2;
    --v2-card-radius: 16px;
    --v2-control-radius: 8px;
    --v2-control-height: 38px;
    --v2-card-shadow: 0 8px 24px rgba(18, 37, 72, .06);
    --v2-font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
    --v2-font-body: 14px;
    --v2-font-h1: 1.75rem;
    --v2-font-h2: 1.125rem;
}

body.user-app-unified {
    --homstir-ink: var(--v2-ink);
    --homstir-muted: var(--v2-muted);
    --homstir-blue: var(--v2-primary);
    --homstir-blue-dark: var(--v2-primary-hover);
    --homstir-line: var(--v2-border);
    --homstir-surface: var(--v2-surface);
    --homstir-canvas: var(--v2-canvas);
    --homstir-shadow: var(--v2-card-shadow);
    --homstir-font: var(--v2-font-family);
    font-size: var(--v2-font-body);
    line-height: 1.5;
    font-family: var(--homstir-font);
}

body.user-app-unified .user-sidebar {
    background: #142849;
}

body.user-app-unified .user-nav a.active,
body.user-app-unified .user-nav-group > summary.active {
    border-color: rgba(255, 255, 255, .15);
    color: #fff !important;
    background: var(--homstir-blue);
    box-shadow: 0 6px 16px rgba(17, 100, 239, .20);
}

body.user-app-unified .user-content h1 {
    font-size: var(--v2-font-h1);
    line-height: 1.2;
}

body.user-app-unified .user-content h2 {
    font-size: var(--v2-font-h2);
    line-height: 1.35;
}

body.user-app-unified .user-content h3 {
    font-size: 1rem;
    line-height: 1.4;
}

body.user-app-unified .user-page-heading h1,
body.user-app-unified .facebook-connect-heading h1,
body.user-app-unified .public-forms-hero h1,
body.user-app-unified .public-form-editor h1,
body.user-app-unified .ai-connect-hero h1 {
    font-size: var(--v2-font-h1);
    line-height: 1.2;
}

body.user-app-unified .user-dashboard-hero h1 {
    font-size: var(--v2-font-h1);
    line-height: 1.2;
}

body.user-app-unified .user-page-heading p,
body.user-app-unified .text-muted,
body.user-app-unified .user-panel-heading small,
body.user-app-unified .user-panel .text-muted,
body.user-app-unified .facebook-connect-heading p,
body.user-app-unified .facebook-connect-panel .facebook-account-subtitle,
body.user-app-unified .ai-connect-heading p,
body.user-app-unified .ai-provider p,
body.user-app-unified .settings-hub-intro p,
body.user-app-unified .settings-card-heading p,
body.user-app-unified .public-forms-hero p,
body.user-app-unified .public-form-card p,
body.user-app-unified .public-form-editor-header p,
body.user-app-unified .public-form-help,
body.user-app-unified .my-ads-timeline-label,
body.user-app-unified .my-ads-campaign-title p,
body.user-app-unified .my-ads-summary-stat > span,
body.user-app-unified .my-ads-campaign-metrics span {
    color: var(--homstir-muted);
}

body.user-app-unified .btn,
body.user-app-unified .ai-button,
body.user-app-unified .mcp-consent-actions button,
body.user-app-unified .public-forms-actions a,
body.user-app-unified .public-form-action,
body.user-app-unified .public-form-editor-actions a,
body.user-app-unified .public-form-editor-actions button {
    min-height: var(--v2-control-height);
    border-radius: var(--v2-control-radius);
    font-weight: 700;
}

body.user-app-unified .btn-primary,
body.user-app-unified .ai-button:not(.ai-button-muted),
body.user-app-unified .mcp-consent-actions button[type="submit"],
body.user-app-unified .public-forms-actions a.primary,
body.user-app-unified .public-form-editor-actions button[type="submit"],
body.user-app-unified .public-form-action[style*="background:#315fe8"] {
    border-color: var(--homstir-blue) !important;
    color: #fff !important;
    background: var(--homstir-blue) !important;
}

body.user-app-unified .btn-primary:hover,
body.user-app-unified .ai-button:not(.ai-button-muted):hover,
body.user-app-unified .mcp-consent-actions button[type="submit"]:hover,
body.user-app-unified .public-forms-actions a.primary:hover,
body.user-app-unified .public-form-editor-actions button[type="submit"]:hover {
    border-color: var(--homstir-blue-dark) !important;
    background: var(--homstir-blue-dark) !important;
}

body.user-app-unified .btn-outline-primary {
    border-color: var(--homstir-blue);
    color: var(--homstir-blue);
}

body.user-app-unified .btn-outline-primary:hover,
body.user-app-unified .btn-outline-primary:focus {
    border-color: var(--homstir-blue-dark);
    color: #fff;
    background: var(--homstir-blue-dark);
}

body.user-app-unified .text-primary {
    color: var(--homstir-blue) !important;
}

body.user-app-unified .btn-danger,
body.user-app-unified .btn-outline-danger,
body.user-app-unified .public-form-action.archive {
    color: #b42332;
}

body.user-app-unified .btn-danger {
    border-color: #b42332;
    color: #fff;
    background: #b42332;
}

body.user-app-unified .btn-outline-danger {
    border-color: #b42332;
}

body.user-app-unified .btn-light,
body.user-app-unified .btn-secondary,
body.user-app-unified .ai-button-muted,
body.user-app-unified .mcp-consent-actions button:not([type="submit"]),
body.user-app-unified .public-forms-actions a:not(.primary),
body.user-app-unified .public-form-action:not(.archive),
body.user-app-unified .public-form-editor-actions a {
    border-color: var(--homstir-line);
    color: #40516b !important;
    background: #fff;
}

body.user-app-unified .user-panel,
body.user-app-unified .user-stat-card,
body.user-app-unified .user-template-entry,
body.user-app-unified .user-template-card,
body.user-app-unified .lead-mobile-card,
body.user-app-unified .settings-card,
body.user-app-unified .settings-directory-card,
body.user-app-unified .facebook-connect-panel,
body.user-app-unified .ai-connect-section,
body.user-app-unified .ai-provider,
body.user-app-unified .ai-connection-card,
body.user-app-unified .mcp-consent,
body.user-app-unified .public-form-editor-card,
body.user-app-unified .public-form-card,
body.user-app-unified .public-forms-empty,
body.user-app-unified .my-ads-campaign-card,
body.user-app-unified .my-ads-preview-post,
body.user-app-unified .my-ads-preview-context {
    border-color: var(--homstir-line);
    border-radius: var(--v2-card-radius);
    background-color: var(--homstir-surface);
    box-shadow: var(--homstir-shadow);
}

body.user-app-unified .user-template-card:hover,
body.user-app-unified .settings-directory-card:hover,
body.user-app-unified .settings-directory-card:focus,
body.user-app-unified .ai-provider:hover {
    box-shadow: var(--homstir-shadow);
}

body.user-app-unified .user-nav a.active,
body.user-app-unified .user-nav-group > summary.active,
body.user-app-unified .settings-directory-icon,
body.user-app-unified .settings-back,
body.user-app-unified .settings-back:hover,
body.user-app-unified .settings-back:focus-visible,
body.user-app-unified .facebook-connect-heading .eyebrow,
body.user-app-unified .ai-button:not(.ai-button-muted),
body.user-app-unified .public-forms-eyebrow,
body.user-app-unified .public-form-editor .eyebrow,
body.user-app-unified .public-form-link,
body.user-app-unified .my-ads-tabs a.is-active,
body.user-app-unified .my-ads-icon-button,
body.user-app-unified .lead-name-link:hover,
body.user-app-unified .lead-appointment-time,
body.user-app-unified .user-template-card-meta span,
body.user-app-unified .user-template-preview-link,
body.user-app-unified .user-template-reset,
body.user-app-unified .user-template-back-link {
    color: var(--homstir-blue);
}

body.user-app-unified .facebook-connected-avatar {
    color: #fff;
    background: var(--homstir-blue);
}

body.user-app-unified .my-ads-tabs a.is-active {
    border-color: var(--homstir-blue);
}

body.user-app-unified .user-template-card-meta span,
body.user-app-unified .settings-directory-icon {
    background: #edf2ff;
}

body.user-app-unified .my-ads-icon-button:focus-visible,
body.user-app-unified .settings-field input:focus,
body.user-app-unified .settings-field select:focus,
body.user-app-unified .settings-field textarea:focus {
    outline-color: rgba(17, 100, 239, .24);
}

body.user-app-unified .my-ads-icon-button:hover {
    border-color: var(--homstir-blue);
    color: var(--homstir-blue-dark);
}

body.user-app-unified .my-ads-icon-button.is-success {
    color: #27834e;
}

body.user-app-unified .my-ads-icon-button.is-danger {
    color: #d04750;
}

body.user-app-unified .my-ads-preview-avatar {
    background: var(--homstir-blue);
}

body.user-app-unified .settings-field input:focus,
body.user-app-unified .settings-field select:focus,
body.user-app-unified .settings-field textarea:focus {
    border-color: var(--homstir-blue);
}

body.user-app-unified .settings-toggle input {
    accent-color: var(--homstir-blue);
}

@media (max-width: 767.98px) {
    body.user-app-unified .user-content h1,
    body.user-app-unified .user-page-heading h1,
    body.user-app-unified .facebook-connect-heading h1,
    body.user-app-unified .public-forms-hero h1,
    body.user-app-unified .public-form-editor h1,
    body.user-app-unified .ai-connect-hero h1,
    body.user-app-unified .user-dashboard-hero h1 {
        font-size: 1.5rem;
    }
}

body.user-app-unified .user-content {
    background: var(--homstir-canvas);
    color: var(--homstir-ink);
}

body.user-app-unified .user-content h1,
body.user-app-unified .user-content h2,
body.user-app-unified .user-content h3,
body.user-app-unified .user-page-heading h1,
body.user-app-unified .facebook-connect-heading h1,
body.user-app-unified .public-forms-hero h1,
body.user-app-unified .public-form-editor h1,
body.user-app-unified .ai-connect-hero h1,
body.user-app-unified .user-dashboard-hero h1 {
    color: var(--homstir-ink);
    font-family: var(--homstir-font);
}

body.user-app-unified .user-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.user-app-unified .user-content select,
body.user-app-unified .user-content textarea,
body.user-app-unified .user-content .form-control {
    border-color: var(--homstir-line);
    border-radius: var(--v2-control-radius);
    background-color: var(--homstir-surface);
    color: var(--homstir-ink);
}

body.user-app-unified .user-content input:focus,
body.user-app-unified .user-content select:focus,
body.user-app-unified .user-content textarea:focus,
body.user-app-unified .user-content .form-control:focus {
    border-color: var(--homstir-blue);
    box-shadow: 0 0 0 3px rgba(17, 100, 239, .14);
}

body.auth-page {
    --homstir-blue: #1164ef;
    --homstir-blue-dark: #0c53cc;
    --homstir-line: #dce5f2;
    --homstir-ink: #142849;
    --homstir-font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
    background-color: var(--v2-canvas);
    background-image: none;
    color: var(--v2-ink);
    font-family: var(--homstir-font);
    font-size: var(--v2-font-body);
}
body.auth-page h1,
body.auth-page h2,
body.auth-page h3,
body.auth-page button,
body.auth-page input,
body.auth-page select {
    font-family: var(--homstir-font);
}
body.auth-page h1 { font-size: var(--v2-font-h1); }
body.auth-page h2 { font-size: var(--v2-font-h2); }
body.auth-page input:not([type="checkbox"]):not([type="radio"]),
body.auth-page select {
    border-color: var(--homstir-line);
    border-radius: 8px;
}
body.auth-page input:focus,
body.auth-page select:focus {
    border-color: var(--homstir-blue);
    box-shadow: 0 0 0 3px rgba(17, 100, 239, .14);
}
body.auth-page .btn-primary {
    border-color: var(--homstir-blue);
    background: var(--homstir-blue);
}
body.auth-page .btn-primary:hover { border-color: var(--homstir-blue-dark); background: var(--homstir-blue-dark); }

body.user-app-unified .alert,
body.user-app-unified .toast,
body.user-app-unified [role="status"].alert {
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(18, 37, 72, .06);
}

body.user-app-unified .alert-success,
body.auth-page .alert-success {
    border-color: #d4eadb;
    background: #eff8f2;
    color: #2d6846;
}

body.user-app-unified .alert-danger,
body.auth-page .alert-danger {
    border-color: #efd5d2;
    background: #fff3f1;
    color: #963f37;
}

body.user-app-unified .alert-info,
body.auth-page .alert-info {
    border-color: #d8e4f5;
    background: #f0f5fc;
    color: #38577f;
}

/* Guest editor runs outside the authenticated shell but shares the same brand tokens. */
.guest-studio-page,
.public-studio-body {
    --homstir-blue: #1164ef;
    --homstir-blue-dark: #0c53cc;
    --homstir-line: #dce5f2;
    --homstir-canvas: #f4f7fc;
    --homstir-surface: #fff;
    --homstir-ink: #142349;
    --homstir-muted: #667692;
    --homstir-font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
}

.guest-studio-page,
.guest-studio-page button,
.guest-studio-page input,
.guest-studio-page select,
.guest-studio-page textarea {
    font-family: var(--homstir-font);
}

.guest-studio-page .studio-button-blue,
.guest-studio-page .studio-preview-switch button.is-active,
.guest-studio-page .guest-copy-choices button.is-selected,
.guest-studio-page .guest-switch input:checked + .guest-switch-track {
    border-color: var(--homstir-blue);
    background-color: var(--homstir-blue);
}

.guest-studio-page .studio-button-blue:hover,
.guest-studio-page .guest-save-bar .studio-button-blue:hover {
    border-color: var(--homstir-blue-dark);
    background-color: var(--homstir-blue-dark);
}

.guest-studio-page .studio-input,
.guest-studio-page .guest-destination-select,
.guest-studio-page .guest-format-picker select {
    border-color: var(--homstir-line);
    border-radius: var(--v2-control-radius);
    background-color: var(--homstir-surface);
    color: var(--homstir-ink);
}

.guest-studio-page .studio-input:focus,
.guest-studio-page select:focus-visible,
.guest-studio-page input:focus-visible,
.guest-studio-page textarea:focus-visible {
    border-color: var(--homstir-blue);
    outline-color: rgba(17, 100, 239, .24);
}

.guest-studio-page select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2352617d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
}

.guest-studio-page .studio-card,
.guest-studio-page .guest-preview-panel {
    border-color: var(--homstir-line);
    background-color: var(--homstir-surface);
}

.guest-studio-page .guest-settings-column .studio-card,
.guest-studio-page .guest-preview-panel {
    box-shadow: var(--homstir-shadow);
}
.guest-studio-page .guest-property-actions .studio-button,
.guest-studio-page .guest-destination-details a,
.guest-studio-page .studio-page-action,
.guest-studio-page .studio-text-link,
.guest-studio-page .studio-header-login:hover {
    color: var(--homstir-blue);
}
.guest-studio-page button:focus-visible,
.guest-studio-page a:focus-visible,
.guest-studio-page select:focus-visible,
.guest-studio-page input:focus-visible,
.guest-studio-page textarea:focus-visible,
.guest-studio-page .guest-switch input:focus-visible + .guest-switch-track {
    outline-color: rgba(17, 100, 239, .32);
}

/* Public lead forms and the multi-step valuation form use the same field and action language. */
body.homstir-public-form,
body.form-layout {
    --homstir-blue: #1164ef;
    --homstir-blue-dark: #0c53cc;
    --homstir-line: #dce5f2;
    --homstir-ink: #142849;
    --homstir-muted: #687b98;
    --homstir-canvas: #f4f7fc;
    --homstir-font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-family: var(--homstir-font);
    font-size: var(--v2-font-body);
}

body.homstir-public-form { background: var(--homstir-canvas); }
body.homstir-public-form .field input,
body.homstir-public-form .field select,
body.homstir-public-form .field textarea {
    border-color: var(--homstir-line);
    border-radius: 8px;
    font-family: var(--homstir-font);
}
body.homstir-public-form .field input:focus,
body.homstir-public-form .field select:focus,
body.homstir-public-form .field textarea:focus {
    border-color: var(--homstir-blue);
    outline-color: rgba(17, 100, 239, .16);
}
body.homstir-public-form .submit,
body.homstir-public-form .thanks a {
    background: var(--homstir-blue);
    font-family: var(--homstir-font);
}
body.homstir-public-form .submit:hover { background: var(--homstir-blue-dark); }
body.homstir-public-form .consent a { color: var(--homstir-blue); }
body.form-layout .hv-input {
    border-color: var(--homstir-line);
    font-family: var(--homstir-font);
}
body.form-layout .hv-input:focus { border-color: var(--homstir-blue); }
body.form-layout .hv-button-next { background-color: var(--homstir-blue); }
body.form-layout .hv-button-next:hover { background-color: var(--homstir-blue-dark); }
body.form-layout {
    background-color: var(--v2-canvas);
    color: var(--v2-ink);
}

/* Shared V2 page and control foundations. */
body.user-app .user-sidebar {
    background: #142849;
}

body.user-app-unified .user-content select:not([multiple]):not(.select2-hidden-accessible),
body.auth-page select:not([multiple]):not(.select2-hidden-accessible),
body.homstir-public-form select,
body.form-layout select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23687b98' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
}

body.user-app-unified .user-content input[type="checkbox"],
body.user-app-unified .user-content input[type="radio"],
body.auth-page input[type="checkbox"],
body.auth-page input[type="radio"] {
    accent-color: var(--v2-primary);
}

body.user-app-unified .alert,
body.auth-page .alert,
body.homstir-public-form .error-box,
body.form-layout .hv-error,
body.user-app-unified [role="status"].alert {
    border-radius: 10px;
}

body.user-app-unified .user-content .btn,
body.auth-page .btn,
body.homstir-public-form .submit,
body.form-layout .hv-button-next {
    min-height: var(--v2-control-height);
    border-radius: var(--v2-control-radius);
    font-family: var(--v2-font-family);
    font-weight: 700;
}

/* Keep the guest and signed-in Ad Studio on the same V2 palette. */
.guest-studio-page,
.public-studio-body {
    --guest-ink: var(--v2-ink);
    --guest-muted: var(--v2-muted);
    --guest-blue: var(--v2-primary);
    --guest-heading: var(--v2-ink);
    --guest-line: var(--v2-border);
    --homstir-blue: var(--v2-primary);
    --homstir-blue-dark: var(--v2-primary-hover);
    --homstir-line: var(--v2-border);
    --homstir-canvas: var(--v2-canvas);
    --homstir-surface: var(--v2-surface);
    --homstir-ink: var(--v2-ink);
    --homstir-muted: var(--v2-muted);
    --homstir-font: var(--v2-font-family);
    --studio-blue: var(--v2-primary);
    background-color: var(--v2-canvas);
}

.member-studio-page .studio-page-action,
.member-studio-page .guest-destination-details button,
.member-studio-page .guest-destination-details a,
.member-studio-page .studio-text-link {
    color: var(--v2-primary);
}

.guest-studio-page .studio-page-action,
.guest-studio-page .guest-destination-details button,
.guest-studio-page .guest-destination-details a,
.guest-studio-page .studio-text-link {
    color: var(--v2-primary);
}

.guest-studio-page .studio-button,
.guest-studio-page .guest-preview-controls button,
.guest-studio-page .guest-save-bar button,
.guest-studio-page .guest-save-bar a {
    border-radius: var(--v2-control-radius);
    font-family: var(--v2-font-family);
    font-weight: 700;
}

.guest-studio-page .studio-button-outline,
.guest-studio-page .guest-preview-controls button:not(.is-selected) {
    border-color: var(--v2-border);
    background-color: var(--v2-surface);
    color: var(--v2-ink);
}

.guest-studio-page .studio-button-blue,
.guest-studio-page .guest-save-bar .studio-button-blue,
.guest-studio-page .studio-preview-cta {
    border-color: var(--v2-primary);
    background-color: var(--v2-primary);
}

.guest-studio-page .studio-button-blue:hover,
.guest-studio-page .guest-save-bar .studio-button-blue:hover,
.guest-studio-page .studio-preview-cta:hover {
    border-color: var(--v2-primary-hover);
    background-color: var(--v2-primary-hover);
}
