/* Zend_Form markup (tables) in the new design. Field look matches .field in design.css */
.zf-form table.formTable,
.zf-form table.formTable tbody,
.zf-form table.formTable tr,
.zf-form table.formTable td { display: block; width: 100%; border: 0; padding: 0; }
.zf-form table.formTable { margin: 0 0 22px; border-collapse: collapse; }
.zf-form table.formTable tr { margin: 14px 0; }
.zf-form table.formTable td:empty,
.zf-form table.formTable td[id$="-label"]:empty { display: none; }
.zf-form label { display: block; margin-bottom: 7px; color: var(--navy); font-size: 11px; font-weight: 800; }
.zf-form label.required::after { content: " *"; color: #c0392b; }
.zf-form input[type=text],
.zf-form input[type=password],
.zf-form input[type=email],
.zf-form textarea,
.zf-form select { width: 100% !important; max-width: 100%; min-height: 41px; padding: 11px 12px; border: 1px solid #cfdae5; border-radius: 6px; background: #fff; color: var(--navy); font-size: 12px; outline: 0; }
.zf-form textarea { height: 98px !important; min-height: 98px; resize: vertical; }
.zf-form input:focus,
.zf-form textarea:focus,
.zf-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0873c914; }
.zf-form table.project { margin: 0 0 22px; padding: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--pale); }
.zf-form .button,
.zf-form input[type=submit],
.zf-form input[type=button] { display: inline-flex; align-items: center; gap: 9px; padding: 13px 19px; border: 0; border-radius: 7px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 5px 13px #0873c92b; }
.zf-form .red-button { background: #fff; color: #c0392b; border: 1px solid #e3b4ae; box-shadow: none; }
.zf-form p[style*="center"] { text-align: left !important; }
.zf-form ul.errors, .zf-form label.error { margin: 6px 0 0; padding: 0; list-style: none; color: #c0392b; font-size: 12px; font-weight: 600; }
.zf-form input.error, .zf-form select.error, .zf-form textarea.error { border-color: #c0392b; }
.zf-form input[type=file] { width: auto; font-size: 12px; }
.request-form .zf-form { max-width: 100%; }

/* News */
.news-read { color: var(--blue); cursor: pointer; text-decoration: none; }
.news-read:hover { text-decoration: underline; }
.news-card h2 a { color: inherit; text-decoration: none; }
.news-card h2 a:hover { color: var(--blue); }
#pager { margin: 30px 0 0; color: #526a80; font-size: 13px; text-align: center; }
#pager #paginator { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 12px; font-size: 0; }
#pager #paginator a, #pager #paginator strong, #pager #paginator .disabled { min-width: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 700; text-align: center; }
#pager a { color: var(--blue); text-decoration: none; }
#pager #paginator a:hover { border-color: var(--blue); }
#pager #paginator strong { border-color: var(--blue); background: var(--blue); color: #fff; }
#pager .disabled { color: #9aa9b8; }

/* Order form: layout of the React request page on top of the Zend_Form tables */
.request-form .zf-form form { counter-reset: project; }
.request-form .zf-form table.formTable:first-of-type tbody { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.request-form .zf-form table.formTable:first-of-type tr { margin: 0; }
.request-form .zf-form .form-heading.project-heading { margin-top: 8px; }
.request-form .zf-form table.project { position: relative; counter-increment: project; padding: 17px; border: 1px solid #dbe5ee; border-radius: 8px; background: #fff; }
.request-form .zf-form table.project::before { content: "Проект " counter(project); display: block; margin-bottom: 14px; color: var(--blue); font-size: 11px; font-weight: 800; }
.request-form .zf-form table.project tbody { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.request-form .zf-form table.project tr { margin: 0; }
.request-form .zf-form table.project tr:has(textarea),
.request-form .zf-form table.project tr:has(.remove-project),
.request-form .zf-form table.project tr:has(.add-file),
.request-form .zf-form table.project tr:has(.priceBox),
.request-form .zf-form table.project tr:has(input[type=checkbox]) { grid-column: 1 / -1; }
.request-form .zf-form table.project tr:has(.remove-project) { position: absolute; top: 12px; right: 14px; width: auto; margin: 0; }
.request-form .zf-form table.project tr:has(.remove-project) td { width: auto; }
.request-form .zf-form .remove-project { padding: 7px 8px; background: transparent; border: 0; box-shadow: none; color: #a34d53; font-size: 11px; font-weight: 800; }
.request-form .zf-form .remove-project:hover { background: #fff1f1; }
.request-form .zf-form .add-file { width: 100%; min-height: 61px; justify-content: center; border: 1px dashed #aabfd1; background: #fff; box-shadow: none; color: var(--blue); font-size: 11px; font-weight: 800; }
.request-form .zf-form .add-project { width: 100%; justify-content: center; padding: 11px; border: 1px dashed var(--blue); background: #fff; box-shadow: none; color: var(--blue); font-size: 12px; }
.request-form .zf-form table.formTable:has(input[type=checkbox]):not(.project) { margin: 0 0 19px; }
.request-form .zf-form table.formTable:not(.project) tr:has(input[type=checkbox]) { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.request-form .zf-form table.formTable:has(input[type=checkbox]) label.required { color: var(--navy); font-size: 16px; font-weight: 800; }
.request-form .zf-form table.formTable:has(input[type=checkbox]) td > label:not(.required):not(.error) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #63778b; font-size: 11px; font-weight: 400; }
.request-form .zf-form input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.request-form .zf-form input[type=submit] { padding-left: 42px; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E") no-repeat 19px center; }
@media (max-width: 800px) {
    .request-form .zf-form table.formTable:first-of-type tbody,
    .request-form .zf-form table.project tbody { grid-template-columns: minmax(0, 1fr); }
}

/* Order form: details of the React request page */
.request-form .zf-form select { -webkit-appearance: none; appearance: none; padding-right: 42px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%230873c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.request-form .zf-form table.project tr:nth-child(2) textarea { height: 80px !important; min-height: 80px; }
.request-form .zf-form table.project tr:has(textarea):last-of-type textarea,
.request-form .zf-form table.project tr:has(#project-0-description) textarea { height: 104px !important; min-height: 104px; }
.request-form .zf-form .remove-project { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.request-form .zf-form .remove-project::before { content: ""; flex: none; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a34d53' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6'/%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E") no-repeat center; }
.request-form .zf-form .add-file { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 12px 12px 43px; text-align: left; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='%230873c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") no-repeat 12px center; }
.request-form .zf-form .add-file strong { color: var(--navy); font-size: 11px; font-weight: 800; }
.request-form .zf-form .add-file small { color: #718599; font-size: 10px; font-weight: 400; }
.request-form .zf-form table.project tr:has(.add-file) td:first-child,
.request-form .zf-form table.project tr:has(.remove-project) td:first-child { display: none; }
.request-form .zf-form table.project tr:has(.add-file) { margin-top: 0; }
.request-form .zf-form table.formTable:has(input[type=checkbox]) label.required { font-weight: 400; }
.request-form .zf-form table.formTable:has(input[type=checkbox]) td > label a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.request-form .zf-form .add-project { gap: 7px; }
.request-form .zf-form .add-project::before { content: ""; flex: none; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230873c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E") no-repeat center; }

/* Client-side validation messages (jQuery validate) */
.zf-form label.error { display: block; flex-basis: 100%; margin: 6px 0 0; color: #c0392b; font-size: 12px; font-weight: 600; text-decoration: none; }

/* Project fields order: document type, time, pages first; discipline and supervisor after */
.request-form .zf-form table.project tr:has(.project-topics) { order: 1; }
.request-form .zf-form table.project tr:has(.project-documentType),
.request-form .zf-form table.project tr:has(.project-urgency),
.request-form .zf-form table.project tr:has(.project-pages) { order: 2; }
.request-form .zf-form table.project tr:has([name$="[program]"]),
.request-form .zf-form table.project tr:has([name$="[supervisor]"]) { order: 3; }
.request-form .zf-form table.project tr:has([name$="[description]"]),
.request-form .zf-form table.project tr:has(.priceBox) { order: 4; }

/* Rows with a chosen file stay above the upload block */
.request-form .zf-form table.project tr:has(input[type=file]) { order: 5; grid-column: 1 / -1; }
.request-form .zf-form table.project tr:has(.add-file) { order: 6; }
.request-form .zf-form table.project td:empty { display: none; }
.request-form .zf-form table.project tr:has(input[type=file]) td { display: flex; align-items: center; gap: 12px; }
.request-form .zf-form .remove-file { padding: 7px 12px; font-size: 11px; }
.request-form .zf-form input[type=file] { width: auto !important; min-height: 0; padding: 0; border: 0; box-shadow: none; font-size: 12px; }

/* Chosen files are shown as chips stacked below the upload block */
.request-form .zf-form table.project tr:has(input[type=file]) { display: none; }
.request-form .zf-form .file-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-top: 8px; }
.request-form .zf-form .file-chip { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 8px; border-radius: 5px; background: #edf6fd; color: var(--navy); font-size: 12px; font-weight: 800; }
.request-form .zf-form .file-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-form .zf-form .file-chip button { display: inline-flex; padding: 2px; border: 0; background: none; color: #a34d53; cursor: pointer; }

/* Top bar and header stay on screen while scrolling */
.site-top { position: sticky; top: 0; z-index: 100; }

/* Request page: the side panel is hidden on phones */
@media (max-width: 800px) {
    .form-aside { display: none; }
}

/* Footer on phones: contacts sit beside "Полезно" instead of taking a full row */
@media (max-width: 680px) {
    .footer-grid { gap: 20px 15px; }
    .footer-grid > .footer-contact { grid-column: auto; }
    .footer .footer-contact .footer-contact-link { min-height: 32px; gap: 7px; font-size: 12px; }
}

/* Breadcrumbs at the top of every page header */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; color: #597087; font-size: 12px; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--navy); font-weight: 700; }


/* No horizontal page scroll on phones (Safari); clip keeps the sticky header working */
html { overflow-x: hidden; }
body { overflow-x: clip; }
.hero-pills > * { min-width: 0; }

/* Top bar on phones: extra right space so the phone number stays clear of the scrollbar */
@media (max-width: 680px) {
    .topbar-inner { padding-right: 16px; }
}

/* Testimonials come from the database and keep their line breaks */
.review-card p, .testimonial-text { white-space: pre-line; }

.page-hero { padding: 26px 0 24px; }
.breadcrumbs { margin-bottom: 10px; }
.page-hero h1 { margin-bottom: 6px; }
@media (max-width: 680px) { .page-hero { padding: 20px 0; } }
