/* Shared baseline for native form controls across the public site and both portals.
   Component-specific layouts may refine these low-specificity defaults. */
:where(button, a[href], [role="button"], summary,
       input[type="button"], input[type="submit"], input[type="reset"], input[type="image"]) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
:where(button, a[href], [role="button"], summary) * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
:where(label:has(input[type="file"]), label:has(input[type="file"]) *) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

:where(form input:not([type]),
       form input[type="text"], form input[type="email"], form input[type="password"],
       form input[type="tel"], form input[type="url"], form input[type="number"],
       form input[type="search"], form input[type="date"], form input[type="time"],
       form input[type="datetime-local"], form select, form textarea) {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #d9e1dc;
    border-radius: 8px;
    background: #fff;
    color: #214a43;
    font: inherit;
    line-height: 1.35;
}

:where(form textarea) { min-height: 82px; resize: vertical; }
:where(form input::placeholder, form textarea::placeholder) { color: #98a69f; opacity: 1; }
:where(form input[type="checkbox"], form input[type="radio"]) { accent-color: #287f76; }
:where(form input:focus-visible, form select:focus-visible, form textarea:focus-visible) {
    outline: 2px solid #339487;
    outline-offset: 2px;
}

/* iOS keeps its native picker as a full-size touch target. The shell owns the
   visible frame so Safari's intrinsic date width cannot crop the right edge. */
.mqc-calendar-control{position:relative;display:flex;align-items:center;box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:44px;border:1px solid #d9e1dc;border-radius:8px;background:#fff;overflow:hidden}
.mqc-calendar-control>input{position:absolute!important;inset:0!important;z-index:2;display:block!important;box-sizing:border-box!important;width:100%!important;max-width:none!important;min-width:0!important;height:100%!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;opacity:0!important;cursor:pointer}
.mqc-calendar-control:focus-within{outline:2px solid #339487;outline-offset:2px}
.mqc-calendar-value{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 38px 0 11px;color:#214a43;font:inherit;font-size:.9rem;font-weight:400;pointer-events:none}
.mqc-calendar-control::after{content:"";position:absolute;right:11px;top:50%;width:17px;height:17px;transform:translateY(-50%);background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='2' y='4' width='14' height='12' rx='2' fill='none' stroke='%23777b80' stroke-width='1.5'/%3E%3Cpath d='M5 2v4M13 2v4M2 8h14' fill='none' stroke='%23777b80' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");pointer-events:none}
.mqc-calendar-control[data-kind="time"]::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='7' fill='none' stroke='%23777b80' stroke-width='1.5'/%3E%3Cpath d='M9 5v4l3 2' fill='none' stroke='%23777b80' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")}
.mqc-calendar-control:has(>input:disabled){opacity:.6}
html[data-portal-theme="dark"] .mqc-calendar-control{background:#1b1f22;border-color:#4a5056}
html[data-portal-theme="dark"] .mqc-calendar-value{color:#eef8f2}
html[data-portal-theme="dark"] :is(input[type="date"],input[type="datetime-local"],input[type="time"]){color-scheme:dark}
html[data-portal-theme="dark"] :is(input[type="date"],input[type="datetime-local"],input[type="time"])::-webkit-calendar-picker-indicator{opacity:1}

/* iOS Safari zooms the whole page when a focused form field renders below 16px.
   Keep manual pinch zoom available; only raise the field text on touch screens. */
@media (max-width: 1024px) and (pointer: coarse) {
    html body :is(form input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]), form select, form textarea) {
        min-height: 44px;
    }
    html body :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"],
           input[type="tel"], input[type="url"], input[type="number"], input[type="search"],
           input[type="date"], input[type="time"], input[type="datetime-local"],
           input[type="month"], input[type="week"], select, textarea) {
        font-size: max(16px, 1em) !important;
    }
}
