/* Dealer Terms and Purchase Confirmation pages: the document text, the signatures and the signing form */

/* The page column: readable line length, centred */
.legal-page {
    max-width: 820px;
    margin: 0 auto;
}

/* "version 3" next to the document title */
.legal-version {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
    margin-left: 8px;
}

/* The document text itself: keeps the line breaks staff typed, scrolls inside its own box when long */
.legal-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 520px;
    overflow: auto;
    padding: 16px 18px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-surface);
    font-size: 0.95rem;
    line-height: 1.55;
}

.legal-text:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* The public legal pages show the whole document without an inner scroll box */
.legal-text--public {
    max-height: none;
    overflow: visible;
}

/* Status chip and links above the text */
.legal-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.legal-subhead {
    font-size: 1.1rem;
    margin: 22px 0 8px;
}

/* One line per party under "Signatures" */
.legal-signature {
    display: grid;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.legal-waiting {
    color: var(--mud-palette-warning);
}

/* The signing form */
.legal-form {
    display: grid;
    gap: 8px;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-surface);
}

.legal-form h2 {
    font-size: 1.1rem;
    margin: 0 0 4px;
}

.legal-form label {
    font-size: 0.9rem;
    font-weight: 500;
}

.legal-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 6px;
    background: transparent;
    color: inherit;
}

/* A tick box and its sentence side by side */
.legal-form .legal-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
}

.legal-form .legal-check input {
    margin-top: 4px;
    flex: 0 0 auto;
}

.legal-submit {
    justify-self: start;
    margin-top: 6px;
    padding: 10px 22px;
    border: 0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--mud-palette-primary);
    cursor: pointer;
}

.legal-submit:hover {
    filter: brightness(1.08);
}
