/* BusinessResults — shared styles for quote + thank-you pages */

:root {
    --brand: #0b5fff;
    --brand-hover: #094ccc;
    --brand-soft: #eaf1ff;
    --text: #1a1a1a;
    --muted: #555;
    --border: #d9dde3;
    --bg: #f7f8fa;
    --card: #ffffff;
    --danger: #c0392b;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; display: block; }

/* Page shell — wraps the legacy outer <form>/<table> */
form {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* Neutralize inline/legacy fixed widths on nested tables
   (code-behind injects raw <table width=675 ...> into panels) */
form table {
    width: 100% !important;
    max-width: 100%;
    border-collapse: collapse;
    border: 0 !important;
}

form table td,
form table th {
    padding: 8px 6px;
    vertical-align: middle;
}

/* Header image: center, cap width, allow shrink */
#HeadImage, img[id$="HeadImage"] {
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
}

/* Strip legacy inline bgcolor from code-behind-injected rows */
form table td[bgcolor="#E4E4E5"],
form table td[bgcolor="#e4e4e5"],
form table td[bgcolor="white"],
form table td[bgcolor="#FFFFFF"],
form table td[bgcolor="#ffffff"],
form table tr[bgcolor],
form table td[bgcolor] {
    background: transparent !important;
}

/* Collapse empty rows that legacy markup injects as spacers */
form table tr:empty,
form table td:empty {
    display: none;
}

/* Card around the form body */
.card,
form > table > tbody > tr > td > table {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    width: 100% !important;
    height: auto !important;
}

/* Labels */
label, .aspLabel {
    color: var(--text);
    font-size: 14px;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
    max-width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

/* Default: inputs sit inline so siblings (area code + number) share a row */
form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="number"],
form input[type="password"],
form select {
    display: inline-block;
    width: auto;
    min-width: 90px;
    margin-right: 6px;
    vertical-align: middle;
}

/* When an input is the ONLY one in its cell, let it fill the cell */
form table td > input[type="text"]:only-child,
form table td > input[type="email"]:only-child,
form table td > input[type="tel"]:only-child,
form table td > input[type="number"]:only-child,
form table td > input[type="password"]:only-child,
form table td > select:only-child {
    width: 100%;
    min-width: 0;
    margin-right: 0;
}

/* Textareas always full-width */
form textarea { display: block; width: 100%; }

/* Collapse block separators inside cells that hold multiple inputs */
form table td br { display: none; }
form table td > span:empty { display: none; }

/* When two text inputs share a cell (area code + number style),
   make the first narrow and the second wider so the pattern is obvious. */
form table td > input[type="text"]:first-of-type:not(:only-of-type) {
    width: 80px;
    text-align: center;
}
form table td > input[type="text"] + input[type="text"] {
    width: 160px;
    margin-left: 4px;
}

/* If the code-behind wrapped each input in its own block wrapper, neutralize it */
form table td > div,
form table td > p {
    display: inline;
    margin: 0;
    padding: 0;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea { min-height: 96px; resize: vertical; }

/* When maxlength is set, use it to size the input */
form input[type="text"][maxlength="2"] { width: 60px; text-align: center; }
form input[type="text"][maxlength="3"] { width: 70px; text-align: center; }
form input[type="text"][maxlength="4"] { width: 80px; text-align: center; }
form input[type="text"][maxlength="5"] { width: 90px; }
form input[type="text"][maxlength="6"] { width: 110px; }
form input[type="text"][maxlength="7"] { width: 130px; }
form input[type="text"][maxlength="8"] { width: 140px; }
form input[type="text"][maxlength="9"],
form input[type="text"][maxlength="10"] { width: 160px; }

@media (max-width: 640px) {
    form input[type="text"][maxlength="2"],
    form input[type="text"][maxlength="3"],
    form input[type="text"][maxlength="4"],
    form input[type="text"][maxlength="5"],
    form input[type="text"][maxlength="6"],
    form input[type="text"][maxlength="7"],
    form input[type="text"][maxlength="8"] {
        margin-bottom: 6px;
    }
}

/* Checkbox & radio lists — ASP.NET renders these as tables */
input[type="checkbox"], input[type="radio"] {
    margin-right: 6px;
    vertical-align: middle;
    accent-color: var(--brand);
}

/* Buttons */
input[type="submit"],
input[type="button"],
button {
    display: inline-block;
    padding: 11px 20px;
    font: 600 15px/1 var(--font);
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, transform .05s;
    min-height: 44px; /* touch target */
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

input[type="submit"]:active,
input[type="button"]:active,
button:active { transform: translateY(1px); }

/* Secondary button: Back / No Thanks */
input[id*="btnBack"],
input[id*="btnno"],
input[id*="PreviousBTN"] {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
input[id*="btnBack"]:hover,
input[id*="btnno"]:hover,
input[id*="PreviousBTN"]:hover {
    background: #f0f2f5;
    border-color: #c4cad3;
}

/* Button row spacing */
form div[style*="float: right"] {
    float: none !important;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Disclaimers / warning labels in red */
span[id*="lblWarning"],
span[id*="lblDisclaimer"] {
    display: block;
    background: #fff8e6;
    border-left: 3px solid #f0b400;
    color: #664d00 !important;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: normal !important;
}

/* Thank-you page emphasis labels */
span[id^="Label3"], span[id^="Label4"] {
    color: var(--text) !important;
}

/* Mobile */
@media (max-width: 640px) {
    form { padding: 10px; }
    .card,
    form > table > tbody > tr > td > table { padding: 12px; }
    input[type="submit"],
    input[type="button"],
    button { width: 100%; }
    form div[style*="float: right"] { flex-direction: column-reverse; }
}

/* Print */
@media print {
    body { background: #fff; }
    .card, form > table > tbody > tr > td > table { box-shadow: none; }
}
