.uwf-form {
    max-width: 600px;
}

.uwf-field {
    margin-bottom: 15px;
}

.uwf-field > label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.uwf-option-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
    margin-bottom: 8px;
    white-space: nowrap;
    font-weight: 400 !important;
    font-size: 15px;
}

.uwf-field input,
.uwf-field textarea,
.uwf-field select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.uwf-field select {
    height: auto;
    line-height: 1.5;
    padding: 10px 12px;
    vertical-align: middle;
}

.uwf-field select option {
    white-space: normal;
    word-wrap: break-word;
}

/* Radio and Checkbox specific styles - IMPORTANT */
.uwf-field input[type="radio"],
.uwf-field input[type="checkbox"] {
    width: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle;
}

.uwf-option-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
    margin-bottom: 8px;
    white-space: nowrap;
}

.uwf-submit {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.uwf-submit:hover {
    background: #005b87;
}

.uwf-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.uwf-required {
    color: red;
}

.uwf-success-message {
    padding: 10px 15px;
    background: #dff0d8;
    border: 1px solid #c3e6cb;
    margin-bottom: 15px;
    border-radius: 4px;
}

.uwf-section-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
    color: #333;
}

.uwf-html-block {
    margin-bottom: 15px;
}

/* Force child elements to inherit styles from styled blocks */
.uwf-section-title[style],
.uwf-html-block[style] {
    border-bottom: none;
}

.uwf-html-block[style] h1,
.uwf-html-block[style] h2,
.uwf-html-block[style] h3,
.uwf-html-block[style] h4,
.uwf-html-block[style] h5,
.uwf-html-block[style] h6,
.uwf-html-block[style] p,
.uwf-html-block[style] span,
.uwf-html-block[style] a {
    color: inherit !important;
    font-weight: inherit !important;
    font-size: inherit !important;
    text-align: inherit !important;
    margin: 0;
}

.uwf-loader {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uwf-spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #ccc;
    border-top-color: #000;
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

/* Grid layout (12-column) */
.uwf-form-grid{
  display:grid;
  grid-template-columns:repeat(12, minmax(0,1fr));
  gap:20px;
}
.uwf-form-grid > [data-col="12"]{ grid-column:span 12; }
.uwf-form-grid > [data-col="6"]{ grid-column:span 6; }
.uwf-form-grid > [data-col="4"]{ grid-column:span 4; }
.uwf-form-grid > [data-col="3"]{ grid-column:span 3; }
/* Fallback for any other col values 1-11 */
.uwf-form-grid > [data-col="1"]{ grid-column:span 1; }
.uwf-form-grid > [data-col="2"]{ grid-column:span 2; }
.uwf-form-grid > [data-col="5"]{ grid-column:span 5; }
.uwf-form-grid > [data-col="7"]{ grid-column:span 7; }
.uwf-form-grid > [data-col="8"]{ grid-column:span 8; }
.uwf-form-grid > [data-col="9"]{ grid-column:span 9; }
.uwf-form-grid > [data-col="10"]{ grid-column:span 10; }
.uwf-form-grid > [data-col="11"]{ grid-column:span 11; }

@media (max-width:768px){
  .uwf-form-grid > *{ grid-column:span 12 !important; }
}


/* Steps / multi-page */
.uwf-step-title{
  margin: 0 0 10px 0;
}
.uwf-step-description{
  margin: 0 0 16px 0;
  color: #555;
}
.uwf-step-nav{
  display:flex;
  gap:12px;
  align-items: center;
  margin-top: 20px;
}
.uwf-step-nav .uwf-step-progress {
  flex: 1;
  text-align: center;
  font-weight: 600;
  color: #666;
}
.uwf-step-nav .button{
  padding:10px 20px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 15px;
}
.uwf-has-error input,
.uwf-has-error select,
.uwf-has-error textarea{
  border-color:#b32d2e;
  outline-color:#b32d2e;
}

.uwf-field-description {
    font-size: 13px;
    color: #666;
    margin: 6px 0 0 0;
    line-height: 1.4;
}
/* ---------------- Signature field ---------------- */
.uwf-signature-wrap {
    border: 1px dashed #8c8f94;
    border-radius: 4px;
    background: #fff;
    padding: 8px;
}

.uwf-signature-pad {
    display: block;
    width: 100%;
    height: 180px;
    background: #fafafa;
    border-radius: 3px;
    cursor: crosshair;
    touch-action: none; /* required for pointer-event drawing on touch devices */
}

.uwf-signature-actions {
    margin-top: 6px;
    text-align: right;
}

.uwf-has-error .uwf-signature-wrap {
    border-color: #b32d2e;
}

/* ============================================================
   Agreement / Document style (opt-in per form via Form Settings)
   Scoped to .uwf-style-agreement so classic forms are untouched
   ============================================================ */

.uwf-form.uwf-style-agreement {
    --uwf-accent: #00b0f0;
    --uwf-ink: #273647;
    --uwf-muted: #5a6b7d;
    --uwf-line: #d9e1e8;
    --uwf-panel: #f7fafc;
    max-width: 880px;
    margin: 30px auto 60px;
    background: #fff;
    border: 1px solid var(--uwf-line);
    border-top: 4px solid var(--uwf-accent);
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(39, 54, 71, 0.08);
    padding: 44px 48px;
    color: var(--uwf-ink);
}

@media (max-width: 768px) {
    /* Pin to the visible viewport: the theme's content column can be wider
       than the screen on mobile, and the form must never inherit that */
    .uwf-form.uwf-style-agreement {
        padding: 24px 18px;
        margin: 16px 14px 40px;
        max-width: calc(100vw - 28px);
        border-radius: 10px;
    }
}

.uwf-form.uwf-style-agreement .uwf-html-block {
    overflow-wrap: anywhere;
}

/* Labels: visible and clear (overrides theme rules that hide classic labels) */
.uwf-form.uwf-style-agreement .uwf-field > label {
    display: block !important;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--uwf-ink);
    margin-bottom: 6px;
}

.uwf-form.uwf-style-agreement .uwf-field {
    margin-bottom: 4px !important;
}

.uwf-form.uwf-style-agreement .uwf-required {
    color: #d21819;
    margin-left: 2px;
}

/* Inputs */
.uwf-form.uwf-style-agreement .uwf-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.uwf-form.uwf-style-agreement .uwf-field select,
.uwf-form.uwf-style-agreement .uwf-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 15px;
    color: var(--uwf-ink);
    background: #fff;
    border: 1px solid var(--uwf-line);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(39, 54, 71, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uwf-form.uwf-style-agreement .uwf-field input:focus,
.uwf-form.uwf-style-agreement .uwf-field select:focus,
.uwf-form.uwf-style-agreement .uwf-field textarea:focus {
    border-color: var(--uwf-accent);
    box-shadow: 0 0 0 3px rgba(0, 176, 240, 0.18);
    outline: none;
}

.uwf-form.uwf-style-agreement .uwf-field textarea {
    min-height: 110px;
}

/* Agreement text: scrollable document panels instead of walls of text */
.uwf-form.uwf-style-agreement .uwf-html-block {
    background: var(--uwf-panel);
    border: 1px solid var(--uwf-line);
    border-left: 4px solid var(--uwf-accent);
    border-radius: 8px;
    padding: 22px 24px;
    max-height: 340px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.65;
    color: var(--uwf-muted);
    margin: 6px 0 10px;
}

.uwf-form.uwf-style-agreement .uwf-html-block h1,
.uwf-form.uwf-style-agreement .uwf-html-block h2,
.uwf-form.uwf-style-agreement .uwf-html-block h3,
.uwf-form.uwf-style-agreement .uwf-html-block h4,
.uwf-form.uwf-style-agreement .uwf-html-block strong {
    color: var(--uwf-ink);
}

.uwf-form.uwf-style-agreement .uwf-html-block::-webkit-scrollbar {
    width: 8px;
}
.uwf-form.uwf-style-agreement .uwf-html-block::-webkit-scrollbar-track {
    background: transparent;
}
.uwf-form.uwf-style-agreement .uwf-html-block::-webkit-scrollbar-thumb {
    background: var(--uwf-line);
    border-radius: 4px;
}
.uwf-form.uwf-style-agreement .uwf-html-block::-webkit-scrollbar-thumb:hover {
    background: var(--uwf-accent);
}

/* Very short html blocks (headings, one-liners) should not look like panels */
.uwf-form.uwf-style-agreement .uwf-html-block.uwf-html-short {
    background: transparent;
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
    font-size: inherit;
    color: var(--uwf-ink);
}

/* Section titles */
.uwf-form.uwf-style-agreement .uwf-section-title {
    border-bottom: 2px solid var(--uwf-accent);
    color: var(--uwf-ink);
    padding-bottom: 10px;
    margin: 30px 0 8px;
}

/* Checkboxes and radios */
.uwf-form.uwf-style-agreement .uwf-option-inline {
    font-size: 15px;
    padding: 10px 16px;
    border: 1px solid var(--uwf-line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin-right: 12px;
}

.uwf-form.uwf-style-agreement .uwf-option-inline:hover {
    border-color: var(--uwf-accent);
    background: rgba(0, 176, 240, 0.05);
}

.uwf-form.uwf-style-agreement .uwf-option-inline input[type="checkbox"],
.uwf-form.uwf-style-agreement .uwf-option-inline input[type="radio"] {
    accent-color: var(--uwf-accent);
    width: 17px !important;
    height: 17px;
}

/* Signature: paper-style pad with a signing baseline */
.uwf-form.uwf-style-agreement .uwf-signature-wrap {
    border: 2px dashed var(--uwf-line);
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    transition: border-color 0.15s ease;
}

.uwf-form.uwf-style-agreement .uwf-signature-wrap:hover {
    border-color: var(--uwf-accent);
}

.uwf-form.uwf-style-agreement .uwf-signature-pad {
    background-color: var(--uwf-panel);
    background-image: linear-gradient(var(--uwf-line), var(--uwf-line));
    background-size: calc(100% - 56px) 1px;
    background-position: center bottom 34px;
    background-repeat: no-repeat;
    border-radius: 8px;
}

.uwf-form.uwf-style-agreement .uwf-signature-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.uwf-form.uwf-style-agreement .uwf-signature-actions::before {
    content: "Draw your signature above the line";
    font-size: 12.5px;
    color: var(--uwf-muted);
}

.uwf-form.uwf-style-agreement .uwf-signature-clear {
    background: transparent;
    border: 1px solid var(--uwf-line);
    border-radius: 6px;
    color: var(--uwf-muted);
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.uwf-form.uwf-style-agreement .uwf-signature-clear:hover {
    border-color: #d21819;
    color: #d21819;
}

/* Step navigation and buttons */
.uwf-form.uwf-style-agreement .uwf-step-nav {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--uwf-line);
}

.uwf-form.uwf-style-agreement .uwf-step-nav .button,
.uwf-form.uwf-style-agreement .uwf-submit {
    border-radius: 8px;
    padding: 13px 34px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(0, 176, 240, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.uwf-form.uwf-style-agreement .uwf-step-nav .button:hover,
.uwf-form.uwf-style-agreement .uwf-submit:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 176, 240, 0.3);
}

/* Messages */
.uwf-form.uwf-style-agreement .uwf-success-message {
    background: #eefaf2;
    border: 1px solid #9adbb4;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 15px;
    color: #1e6b3a;
}

.uwf-form.uwf-style-agreement .uwf-field-description {
    color: var(--uwf-muted);
}

.uwf-form.uwf-style-agreement .uwf-has-error input,
.uwf-form.uwf-style-agreement .uwf-has-error select,
.uwf-form.uwf-style-agreement .uwf-has-error textarea {
    border-color: #d21819;
    box-shadow: 0 0 0 3px rgba(210, 24, 25, 0.12);
}

/* Lead heading: first short html block in an agreement form reads as the document title */
.uwf-form.uwf-style-agreement .uwf-form-grid > .uwf-html-short:first-child {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: var(--uwf-ink) !important;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--uwf-line);
    margin-bottom: 6px;
}

/* ---------------- Thank-you screen (agreement-style forms) ---------------- */
.uwf-thankyou {
    text-align: center;
    padding: 20px 0 10px;
}

.uwf-ty-tick {
    width: 92px;
    height: 92px;
    margin: 6px auto 20px;
}

.uwf-ty-tick svg {
    width: 100%;
    height: 100%;
}

.uwf-ty-circle {
    fill: #eefaf2;
    stroke: #2e9e5b;
    stroke-width: 3;
    stroke-dasharray: 183;
    stroke-dashoffset: 183;
    animation: uwfDrawCircle 0.7s ease-out forwards;
}

.uwf-ty-check {
    fill: none;
    stroke: #2e9e5b;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: uwfDrawCheck 0.45s ease-out 0.55s forwards;
}

@keyframes uwfDrawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes uwfDrawCheck {
    to { stroke-dashoffset: 0; }
}

.uwf-ty-heading {
    margin: 0 0 4px;
    font-size: 30px;
    font-weight: 700;
    color: #273647;
}

.uwf-ty-formname {
    margin: 0 0 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2e9e5b;
}

.uwf-ty-message {
    max-width: 560px;
    margin: 0 auto 10px;
    font-size: 16px;
    line-height: 1.6;
    color: #5a6b7d;
}

.uwf-ty-copy {
    margin: 0 auto 26px;
    font-size: 14.5px;
    color: #5a6b7d;
}

.uwf-ty-copy strong {
    color: #273647;
}

.uwf-ty-details {
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
    background: #f7fafc;
    border: 1px solid #d9e1e8;
    border-radius: 10px;
    padding: 24px 28px;
}

.uwf-ty-details h3 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: #273647;
    padding-bottom: 10px;
    border-bottom: 2px solid #2e9e5b;
}

.uwf-ty-details dl {
    margin: 0;
}

.uwf-ty-row {
    display: flex;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #e6ecf1;
}

.uwf-ty-row:last-child {
    border-bottom: none;
}

.uwf-ty-row dt {
    flex: 0 0 42%;
    font-weight: 600;
    font-size: 13.5px;
    color: #273647;
    text-transform: none;
    letter-spacing: normal;
}

.uwf-ty-row dd {
    flex: 1;
    margin: 0;
    font-size: 13.5px;
    color: #5a6b7d;
    overflow-wrap: anywhere;
    text-transform: none;
    letter-spacing: normal;
}

.uwf-ty-signature {
    max-height: 70px;
    background: #fff;
    border: 1px solid #d9e1e8;
    border-radius: 6px;
    padding: 4px 10px;
}

@media (max-width: 600px) {
    .uwf-ty-row {
        flex-direction: column;
        gap: 2px;
    }
    .uwf-ty-details {
        padding: 18px 16px;
    }
}
