@font-face {
    font-family: GillZenit;
    src: url("../../assets/fonts/GillSansMT.ttf") format("truetype");
    font-display: swap;
}

:root {
    --zenit-ink: #023047;
    --zenit-action: #07526c;
    --zenit-accent: #219ebc;
    --zenit-muted: #506875;
    --zenit-line: #dbe5e8;
    --zenit-bg: #f1f6f8;
    --zenit-surface: #fff;
}

body {
    background: radial-gradient(ellipse at top right, #e0eff4, transparent 38rem), var(--zenit-bg);
    color: var(--zenit-ink);
    font: 16px/1.55 system-ui, sans-serif;
}

#container {
    box-sizing: border-box;
    width: min(100% - 2rem, 72rem);
    min-width: 0;
    margin: clamp(1rem, 4vw, 3rem) auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

#header, #content {
    box-sizing: border-box;
    width: 100%;
    margin-inline: 0;
    padding: clamp(1rem, 3.6vw, 2.5rem);
    background: var(--zenit-surface);
    border: 1px solid var(--zenit-line);
    border-radius: 1.25rem;
    box-shadow: 0 12px 30px rgb(2 48 71 / 6%);
}

#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    height: auto;
    padding-block: .85rem;
}

#header > .pull-right { order: 1; margin: 0; }
#header p { width: auto; margin: 0; padding: 0; }
#header #logo { display: flex; align-items: center; width: auto; height: auto; }
#logo img { max-width: min(11rem, 60vw); max-height: 2.75rem; object-fit: contain; }

#nav {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    box-sizing: border-box;
    height: auto;
    margin: .75rem 0;
    padding: .35rem;
    list-style: none;
    background: #e4eff3;
    border: 0;
    border-radius: 1rem;
    box-shadow: none;
}

#nav li { float: none; margin: 0; }
#container #nav li > a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 .9rem;
    height: auto;
    margin: 0;
    background-image: none;
    border: 0;
    border-radius: .75rem;
    color: var(--zenit-ink);
    font-weight: 600;
}
#nav li > a.active, #nav li > a:hover { background-color: var(--zenit-surface); color: var(--zenit-action); }
#footer { color: var(--zenit-muted); padding: 1.25rem 0; }
#content { min-height: 0; }
#content h1, #content h2, #content h3 {
    color: var(--zenit-ink);
    font-family: GillZenit, system-ui, sans-serif;
    line-height: 1.1;
    overflow-wrap: anywhere;
}
#content h1 { max-width: 32ch; font-size: clamp(2rem, 5vw, 3.25rem); }
#content a { color: var(--zenit-action); text-underline-offset: .18em; }
#content :is(input, select, textarea, button) { font: inherit; }
#content :is(input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], select, textarea) {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 2.75rem;
    padding: .55rem .75rem;
    color: var(--zenit-ink);
    background: #f8fbfc;
    border: 1px solid #9eb4bf;
    border-radius: .65rem;
}
#container :focus-visible { outline: 3px solid var(--zenit-accent); outline-offset: 3px; }
#content :is(input[type=submit], button[type=submit], input[type=reset], input[type=button], .action-button, .front-page-button a.button) {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    min-height: 2.75rem;
    padding: .55rem .95rem;
    border: 1px solid var(--zenit-line);
    border-radius: .75rem;
    background: #edf5f8;
    color: var(--zenit-ink);
    text-decoration: none;
    box-shadow: none;
    text-shadow: none;
    font-weight: 650;
    cursor: pointer;
    transition: background-color .16s ease;
}
#content :is(input[type=submit], button[type=submit], .front-page-button a.blue) {
    background: var(--zenit-action);
    border-color: var(--zenit-action);
    color: #fff !important;
}
#content :is(input[type=submit], button[type=submit], .front-page-button a.blue):hover { background: var(--zenit-ink); }
#content :is(input[type=reset], input[type=button], .action-button):hover { background: #dceef4; }

#content:has(#clientLogin) > :is(h1, p),
#content:has(#ticketForm) > p {
    margin-inline: auto;
    text-align: center;
}
#content:has(#clientLogin) > p,
#content:has(#ticketForm) > p {
    max-width: 58ch;
    color: var(--zenit-muted);
}
#content #clientLogin {
    box-sizing: border-box;
    max-width: 42rem;
    width: 100%;
    margin-inline: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
#clientLogin > div { display: grid !important; gap: 1rem; }
#clientLogin .login-box {
    box-sizing: border-box;
    width: 100%;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--zenit-line);
    border-radius: 1rem;
    background: var(--zenit-bg);
    box-shadow: none;
}
#clientLogin .login-box input { width: 100%; margin-block: .3rem; }
#clientLogin .login-box strong { color: #98263c; }
#clientLogin .login-box p { margin: .4rem 0 0; }
#clientLogin > div > div:not(.login-box) {
    padding: 0 !important;
    text-align: center;
    font-size: .875rem;
}

#content .search.well {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: 1rem;
    margin-block: 1rem;
    background: var(--zenit-bg);
    border: 1px solid var(--zenit-line);
    border-radius: 1rem;
}
#content .states { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-inline-start: auto; }
#content > h1:has(.states), #ticketInfo h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .8rem;
    max-width: none;
    font-size: clamp(1.4rem, 3vw, 2rem);
}
#content h1 .refresh {
    color: var(--zenit-action);
    font-size: .6em;
    vertical-align: .12em;
}
#content .states small, #ticketInfo h1 small {
    font: 600 .9rem/1.4 system-ui, sans-serif;
}
#ticketInfo h1 > .pull-right {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-inline-start: auto;
}
#content #ticketInfo .action-button {
    margin: 0;
    font: 600 .85rem/1.2 system-ui, sans-serif;
}
#content .search.well > .flush-left { flex: 1 1 100%; min-width: 0; }
#ticketSearchForm {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin: 0;
}
#ticketSearchForm input[name=keywords] { width: min(100%, 19rem); min-width: 0; }
#ticketSearchForm > .pull-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-inline-start: .5rem;
}
#ticketTable, #ticketInfo { width: 100%; }
#ticketTable {
    font-size: .9rem;
    border: 1px solid var(--zenit-line);
    border-radius: .65rem;
    border-spacing: 0;
}
#ticketTable caption {
    caption-side: bottom;
    padding: .6rem 0;
    background: transparent;
    border: 0;
    color: var(--zenit-muted);
    font-weight: 400;
}
#ticketTable th, #ticketTable td {
    padding: .8rem .9rem;
    border: 0;
    border-bottom: 1px solid var(--zenit-line);
    text-align: start;
}
#ticketTable th { background: #e0edf1; font-weight: 600; }
#ticketTable th:first-child { border-top-left-radius: .6rem; }
#ticketTable th:last-child { border-top-right-radius: .6rem; }
#ticketTable th a { color: var(--zenit-muted); }
#ticketTable th i { color: #617b89; font-size: .75em; }
#ticketTable tbody td { background: transparent; }
#ticketTable tbody tr:last-child td { border-bottom: 0; }
#ticketTable td a.Icon { background-image: none; padding-inline-start: 0; }
#ticketTable .link.truncate {
    max-height: none !important;
    max-width: none !important;
    white-space: normal;
    overflow-wrap: anywhere;
}
#ticketTable tbody tr:hover td { background: #f0f8fb; }
#ticketInfo .headline { background: #e9f3f7; color: var(--zenit-ink); }
#content .action-button i, #content .states i { color: var(--zenit-action); }
#reply { margin-top: 1.5rem; }
#reply .redactor-box, #reply .redactor-toolbar, #reply .redactor-editor { max-width: 100%; }

@media (max-width: 700px) {
    #ticketTable { display: block; overflow-x: auto; }
    #ticketTable :is(th, td) { min-width: 6rem; }
    #ticketInfo > tbody > tr > td { overflow-wrap: anywhere; }
    #ticketSearchForm > .pull-right { flex-basis: 100%; margin-inline-start: 0; }
    #clientLogin .login-box { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    #content :is(input, .action-button) { transition: none; }
}

body {
    min-height: 100vh;
    isolation: isolate;
    background: #e0edf1;
}
body::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: clamp(15rem, 56.28vw, 32rem);
    background: linear-gradient(100deg, #023047f5, #023047a6),
        url("../../assets/images/z10-irrigation-concept.webp") center center / cover no-repeat,
        #023047;
}
#container { max-width: 68rem; margin-block-start: 0; }
.zenit-masthead {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: .6rem 1rem; padding: 1.25rem 0; color: white; font-size: .875rem;
}
.zenit-masthead > a { color: white; font-weight: 750; letter-spacing: .12em; }
.zenit-languages { display: flex; align-items: center; gap: .3rem; padding: .2rem .4rem; border: 1px solid #ffffff60; border-radius: 2rem; }
.zenit-languages a { color: white; padding: .2rem .6rem; border-radius: 2rem; }
.zenit-languages a[aria-current] { background: white; color: var(--zenit-ink); }
body:has(.zenit-languages) #header a.flag { display: none; }
#header { flex-direction: column; gap: .6rem; padding-block: 1.3rem; border-radius: .75rem .75rem 0 0; }
#header #logo img { max-width: 10rem; max-height: 3.2rem; }
#nav {
    justify-content: center;
    gap: clamp(.25rem, 2vw, 1.65rem);
    margin-top: 0;
    padding: 1.1rem .65rem;
    background: #f4f7f8;
    border-radius: 0 0 .75rem .75rem;
}
#container #nav li > a {
    gap: .55rem;
    min-height: 3rem;
    padding-inline: .75rem;
    border-radius: .55rem;
    color: var(--zenit-muted);
    font-size: .9rem;
    font-weight: 500;
}
#container #nav li > a.active {
    background: var(--zenit-ink);
    color: white;
    font-weight: 700;
}
#nav a:is(.home, .new, .tickets, .status, .kb)::before {
    font: normal .8rem/1 FontAwesome;
}
#nav a.home::before { content: "\f015" / ""; }
#nav a.new::before { content: "\f067" / ""; }
#nav a.tickets::before { content: "\f03a" / ""; }
#nav a.status::before { content: "\f002" / ""; }
#nav a.kb::before { content: "\f02d" / ""; }
#content { border: none; border-radius: .75rem; }
#content > h1:has(.states) {
    justify-content: center;
    row-gap: 1rem;
    margin-block: 1.5rem 1rem !important;
}
#content > h1:has(.states) > a .refresh,
#content > h1:has(.states) .states small > :is(i, span) { display: none; }
#content h1 > .states { flex-basis: 100%; justify-content: center; margin: 0; }
#content .states small { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
#content .states a {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: 0 .9rem;
    border: 1px solid var(--zenit-line);
    border-radius: 2rem;
}
#content .states a.active { background: var(--zenit-ink); color: white; }
#content:has(#ticketForm) > h1, #content:has(form[action="profile.php"]) > h1 {
    margin-inline: auto; text-align: center; font-size: clamp(1.75rem, 4vw, 2.4rem);
}
#ticketForm, #content form[action="profile.php"] { max-width: 46rem; margin-inline: auto; }
#ticketForm table, #content form[action="profile.php"] table { max-width: 100%; }

#content:has(.zenit-support-hero) { padding: 0; }
#landing_page .front-page-button, #landing_page .main-content > .thread-body { display: none; }
#landing_page .search-form, #landing_page .sidebar section { padding-inline: 1rem; }
.zenit-support-hero, .zenit-support-topics, .zenit-support-process, .zenit-support-urgent {
    padding: clamp(1.3rem, 5vw, 3.5rem);
}
.zenit-support-hero {
    text-align: center;
    background: #f4f7f8;
    border-radius: inherit;
}
#content .zenit-support-hero h1,
#content:has(#clientLogin) > h1,
#content .zenit-support-process h2,
#content .zenit-support-urgent h2 {
    font-size: clamp(1.85rem, 4vw, 2.5rem);
}
#content .zenit-support-hero h1 { max-width: none; margin: 0; }
.zenit-support-hero p { max-width: 66ch; margin: 1rem auto 0; color: var(--zenit-muted); }
.zenit-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
#content .zenit-actions a {
    display: inline-flex; align-items: center; gap: .65rem; justify-content: center;
    min-height: 3rem; box-sizing: border-box; padding: .55rem 1.35rem;
    border: 2px solid var(--zenit-ink); border-radius: 2rem;
    color: var(--zenit-ink); font-weight: 650;
}
#content .zenit-actions .zenit-primary { background: var(--zenit-ink); color: white; }
#content .zenit-actions a:hover { box-shadow: 0 3px 8px #02304726; }
.zenit-support-topics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2rem; }
.zenit-topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.zenit-topic-grid a { display: grid; align-content: start; gap: .4rem; padding: 1.15rem; border-radius: .65rem; background: #e6f0f3; }
.zenit-topic-grid a:hover { background: #d4e9f0; }
.zenit-topic-grid :is(h3, p), .zenit-support-process :is(h3, p) { margin: 0; }
.zenit-topic-grid p, .zenit-support-process p { color: var(--zenit-muted); font-size: .9rem; }
.zenit-support-process { background: #e6f0f3; }
#content .zenit-support-process h2, #content .zenit-support-urgent h2 {
    margin: 0; text-wrap: balance;
}
#content .zenit-support-process h3 { font-size: 1.32rem; }
.zenit-support-process ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.7rem 0 0;
    padding: 0;
    list-style: none;
}
.zenit-support-process li {
    display: grid; align-content: start; gap: .55rem;
    padding: 1.15rem;
    background: #f8fbfc;
    border: 1px solid #c6dce4;
    border-radius: .85rem;
}
.zenit-support-process li > i {
    display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
    margin-bottom: .35rem; border-radius: .75rem;
    background: #ddedf3; color: var(--zenit-action);
}
.zenit-support-urgent {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1.35rem; color: white;
    background: var(--zenit-ink);
    border-radius: 0 0 .75rem .75rem;
}
#content .zenit-support-urgent h2 { color: white; }
.zenit-support-urgent p { margin: .65rem 0 0; color: #e0edf1; }
#content .zenit-support-urgent a {
    display: inline-flex; align-items: center; gap: .85rem;
    padding: .75rem 1rem; border-radius: .85rem;
    background: white; color: var(--zenit-ink); line-height: 1.2;
}
.zenit-support-urgent a strong, .zenit-support-urgent a span span { display: block; }
.zenit-support-urgent a span span { margin-top: .25rem; color: var(--zenit-muted); font-size: .82rem; }
#content .zenit-support-urgent a:hover { background: #e0edf1; }
@media (prefers-reduced-motion: no-preference) {
    .zenit-support-urgent a { transition: transform .18s ease; }
    .zenit-support-urgent a:hover { transform: translateY(-2px); }
}

@media (max-width: 660px) {
    .zenit-support-topics, .zenit-support-process ol { grid-template-columns: 1fr; }
    #nav {
        flex-direction: column;
        align-items: center;
        gap: .35rem;
    }
    #container #nav li > a {
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
}
@media (max-width: 420px) {
    .zenit-topic-grid { grid-template-columns: 1fr; }
}
