:root {
    --uf-accent: var(--main-color, #ec6b81);
    --uf-accent-dark: #d9536b;
    --uf-border: #e0e0e0;
    --uf-border-strong: #cfcfcf;
    --uf-muted: #6b6b6b;
}

/* ---- Forms list (My account + custom page) ---- */
.user-forms-list {
    list-style: none;
    max-width: 860px;
    margin: 0 auto 24px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
}

.user-forms-list li {
    margin: 0;
}

.user-forms-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 18px;
    border: 1px solid var(--uf-border);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.user-forms-list a:hover {
    border-color: var(--uf-accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.user-forms-list .material-symbols-outlined {
    font-size: 30px;
    flex: 0 0 auto;
    color: var(--uf-accent);
}

.user-forms-list-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-forms-list-title {
    font-weight: 700;
    font-size: 15px;
}

.user-forms-list-desc {
    font-size: 13px;
    line-height: 1.4;
    color: var(--uf-muted);
}

/* Keep the page heading, subtitle and status messages aligned with the
   centered form card (scoped to the forms page, not global .error/.success). */
.uf-print-area .h2,
.uf-print-area .pheader,
.uf-print-area .success,
.uf-print-area .error {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

/* Center the form title and subtitle; make the page title bold. */
.uf-print-area .h2,
.uf-print-area .pheader {
    text-align: center;
}

.uf-print-area .h2 {
    font-weight: 700;
}

/* ---- Form card ---- */
/* Top margin adds breathing room below the form subtitle (.pheader). */
.user_forms {
    max-width: 860px;
    margin: 22px auto 10px;
    padding: 28px 30px 26px;
    background: #fff;
    border: 1px solid var(--uf-border);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.user_forms .required {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--uf-muted);
}

.user_forms .required sup,
.uf-field sup {
    color: var(--secondary-color, #c00);
}

/* The required-marker superscript must not inflate the label's line box,
   otherwise a required field's input sits lower than an adjacent optional
   one in the same grid row. */
.uf-field label sup {
    line-height: 0;
}

/* Section headings (rendered as p.h3 by the renderer) */
.user_forms .h3 {
    margin: 30px 0 16px;
    padding-bottom: 9px;
    border-bottom: 1px solid #ececec;
    font-size: 16px;
    font-weight: 700;
}

.user_forms > .pheader + form .h3:first-of-type,
.user_forms .h3:first-child {
    margin-top: 6px;
}

.uf-section-desc {
    margin: 0 0 14px;
    color: var(--uf-muted);
    font-size: 14px;
}

/* ---- Fields ---- */
.uf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.uf-field label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.uf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin-bottom: 6px;
}

.uf-grid > .uf-full {
    grid-column: 1 / -1;
}

.uf-stack {
    display: block;
    margin-bottom: 6px;
}

.uf-group-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}

/* ---- Inputs (override the theme's base input quirks) ---- */
.user_forms .input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-width: 0;
    min-height: 0;
    padding: 10px 12px;
    border: 1px solid var(--uf-border-strong);
    border-radius: 7px;
    background: #fff;
    font-size: 14px;
    line-height: 1.3;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.user_forms textarea.input {
    min-height: 120px;
    resize: vertical;
}

.user_forms .input:focus {
    border-color: var(--uf-accent);
    box-shadow: 0 0 0 3px rgba(236, 107, 129, 0.22);
    outline: none;
}

.user_forms .input::placeholder {
    color: #aaa;
}

/* ---- Boxes ---- */
.uf-notice {
    margin: 18px 0;
    padding: 14px 16px;
    background: #fdf3f5;
    border: 1px solid #f6d6dd;
    border-left: 4px solid var(--uf-accent);
    border-radius: 6px;
    font-size: 14px;
}

.uf-info-box {
    background: #fafafa;
    border: 1px solid var(--uf-border);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 12px 0;
    font-size: 14px;
}

.uf-info-box p {
    margin: 4px 0;
}

.uf-info-box ol {
    margin: 6px 0 0;
    padding-left: 20px;
}

.uf-info-box li {
    margin-bottom: 6px;
}

/* ---- Checklist ---- */
.uf-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
    margin-top: 4px;
}

.uf-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.uf-check-item input {
    width: auto;
    min-width: 0;
    margin: 3px 0 0;
    accent-color: var(--uf-accent);
}

/* ---- Repeatable products table ---- */
.uf-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--uf-border);
    border-radius: 8px;
}

.uf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.uf-table th,
.uf-table td {
    border-bottom: 1px solid #ececec;
    border-right: 1px solid #f0f0f0;
    padding: 8px 10px;
    vertical-align: middle;
}

.uf-table th:last-child,
.uf-table td:last-child {
    border-right: 0;
}

.uf-table tbody tr:last-child td {
    border-bottom: 0;
}

.uf-table th {
    background: #f7f7f7;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-align: left;
    color: #555;
}

.uf-table td .input {
    padding: 8px 9px;
    border-radius: 5px;
}

.uf-add-row {
    margin-top: 12px;
}

.uf-reason-list {
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--uf-muted);
    font-size: 14px;
}

.uf-reason-list li {
    margin-bottom: 5px;
}

/* ---- Actions ---- */
.user_forms .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid #ececec;
}

.user_forms .actions .button {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 13px;
}

.user_forms .actions .submit_button {
    min-width: 200px;
    border-radius: 8px;
    border: 2px solid var(--uf-accent);
    background: var(--uf-accent);
    transition: background .15s ease, border-color .15s ease;
}

.user_forms .actions .submit_button:hover {
    background: var(--uf-accent-dark);
    border-color: var(--uf-accent-dark);
}

.user_forms .actions .button.secondary {
    background: #fff;
    color: #222;
    border: 1px solid var(--uf-border-strong);
    font-weight: 700;
}

.user_forms .actions .button.secondary:hover {
    border-color: #222;
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
    .user_forms {
        padding: 20px 18px;
    }

    .uf-grid,
    .uf-checklist {
        grid-template-columns: 1fr;
    }
}

/* ---- Print ---- */

/* The print-area table wrapper is layout-neutral on screen; its spacer rows
   have no height until printing. */
.uf-print-area {
    width: 100%;
    border-collapse: collapse;
}

.uf-print-area > tbody > tr > td,
.uf-print-spacer td {
    padding: 0;
}

/* Zero page margin suppresses the browser-generated header/footer (URL, page
   title); the print area carries its own padding instead. */
@page {
    margin: 0;
}

@media print {
    /* Remove everything except the path to the form, so hidden content takes
       no space (leftover space produced empty trailing pages). */
    body > *:not(#container),
    #container > *:not(#page),
    #page > *:not(#center_column),
    #center_column > *:not(.uf-print-area),
    .uf-print-area .actions,
    .uf-print-area .uf-add-row,
    .uf-print-area .error,
    .uf-print-area .success,
    .uf-print-area p.required {
        display: none;
    }

    /* Collapse the theme's fixed-width column layout so the form fills the
       paper width instead of being shrunk-to-fit and pushed left. */
    body,
    #container,
    #page,
    #center_column {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    /* Horizontal page margins live on the cell: padding on a border-collapse
       table is ignored per spec. */
    .uf-print-area > tbody > tr > td {
        padding: 0 12mm;
    }

    /* Repeated on every printed page: vertical page margins. */
    .uf-print-spacer td {
        height: 10mm;
    }

    .user_forms {
        border: 0;
        box-shadow: none;
        padding: 0;
        max-width: none;
    }

    .user_forms .input,
    .user_forms textarea,
    .user_forms select {
        border: 1px solid #999;
    }

    /* Sections flagged break_before => true start on a new printed page. */
    .uf-page-break {
        page-break-before: always;
        break-before: page;
    }
}
