/**
 * Accessibility enhancements for date/time pickers
 * Makes calendar button completely invisible to sighted users but accessible to screen readers and keyboard
 * Only the icon remains visible, matching the original visual appearance
 */

/* Visible calendar glyph. It is a sibling of the transparent button so it is
   never affected by the button's opacity:0 (a child would be invisible). */
.input-group-addon .calendar-icon {
    position: relative;
    z-index: 0;
    opacity: 1;
    pointer-events: none;
    color: inherit;
    display: inline-block;
    font-size: 14px;
    line-height: 1;
}

/* Calendar button - transparent overlay over the addon; invisible to sighted
   users but fully clickable / keyboard- and screen-reader-accessible. */
.calendar-icon-button {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
    opacity: 0;
    z-index: 2;
    /* Make it accessible to screen readers and keyboard */
    clip: auto;
    clip-path: none;
}

/* Focus state for keyboard navigation - show outline when focused. The
   translucent background keeps the glyph behind it visible. */
.calendar-icon-button:focus {
    opacity: 1;
    outline: 2px solid currentColor;
    outline-offset: -2px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.05);
}

/*
 * Input group addon: positioning context for the transparent button below.
 *
 * Do NOT set display here. .input-group is a Bootstrap table and it only lays out
 * horizontally while its children are table-cell; this rule used to say
 * display:flex, unscoped, which broke every input-group in the application and
 * dropped the calendar button onto its own row beneath the field. The flex was
 * only ever centring the glyph, and a table-cell already centres it through
 * text-align and vertical-align, both of which Bootstrap sets by default.
 */
.input-group-addon {
    position: relative;
}

/* Ensure button covers the entire addon area */
.input-group-addon .calendar-icon-button {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* RTL support */
[dir="rtl"] .input-group-addon .calendar-icon-button {
    left: auto;
    right: 0;
}

/* The one accessible date component: a big month calendar (a large
   grid the user picks the day from), in popover mode over admin pages
   and inline in a hosting step. */
.oparo-a11y-dp-popover {
    position: fixed;
    z-index: 10060;
    width: min(92vw, 600px);
    min-width: 320px;
    max-width: 600px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    corner-shape: squircle;
    box-shadow: 0 8px 24px rgba(60, 64, 67, 0.18), 0 0 1px rgba(60, 64, 67, 0.12);
}
/* Inline mode: the same calendar in the flow of its hosting step, at
   the same large size; choosing a day commits at once, so the Confirm
   button has no work and is not shown. */
.oparo-a11y-dp-popover.is-inline {
    position: static;
    z-index: auto;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08), 0 0 1px rgba(60, 64, 67, 0.12);
}
.oparo-a11y-dp-popover.is-inline [id="oparo-a11y-dp-confirm"] {
    display: none;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-month {
    font-size: 20px;
    font-weight: 500;
    color: #3c4043;
    margin: 0;
    flex: 1;
    text-align: center;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-nav {
    border: 0;
    background: transparent;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #5f6368;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-nav:hover,
.oparo-a11y-dp-popover .oparo-a11y-dp-nav:focus {
    background: #f1f3f4;
    outline: none;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #70757a;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-week {
    display: contents;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-day {
    border: 0;
    background: transparent;
    height: 52px;
    border-radius: 50%;
    font-size: 15px;
    color: #3c4043;
    cursor: pointer;
    padding: 0;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-day:hover:not(:disabled),
.oparo-a11y-dp-popover .oparo-a11y-dp-day:focus {
    background: #e8f0fe;
    outline: none;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-day.is-out {
    /* Secondary against the in-month days, still readable: these
       are live buttons (they navigate and select), so their text
       meets the same contrast floor as any other day. */
    color: #5f6368;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-day.is-today {
    color: #174ea6;
    font-weight: 600;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-day.is-selected {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
}
/* Unavailable days are greyed: out-of-range days and days the host
   declared disabled (is-option-disabled) share the one treatment. */
.oparo-a11y-dp-popover .oparo-a11y-dp-day:disabled,
.oparo-a11y-dp-popover .oparo-a11y-dp-day.is-disabled {
    cursor: default;
    opacity: 0.35;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-field {
    margin-top: 10px;
}
.oparo-a11y-dp-popover .oparo-a11y-dp-foot {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8eaed;
}

/* Global accessible time dialog (admin) */
.oparo-a11y-tp-popover {
    position: fixed;
    z-index: 10061;
    min-width: 280px;
    max-width: 320px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    corner-shape: squircle;
    box-shadow: 0 8px 24px rgba(60, 64, 67, 0.18), 0 0 1px rgba(60, 64, 67, 0.12);
}
.oparo-a11y-tp-popover .oparo-a11y-tp-title {
    font-size: 15px;
    font-weight: 500;
    color: #3c4043;
    margin: 0 0 10px;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-fs {
    border: 0;
    margin: 0 0 10px;
    padding: 0;
    min-width: 0;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-legend {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    margin: 0 0 6px;
    padding: 0;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-hour-grid,
.oparo-a11y-tp-popover .oparo-a11y-tp-minute-grid {
    display: grid;
    gap: 4px;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-hour-grid {
    grid-template-columns: repeat(6, 1fr);
}
.oparo-a11y-tp-popover .oparo-a11y-tp-minute-grid {
    grid-template-columns: repeat(6, 1fr);
}
.oparo-a11y-tp-popover .oparo-a11y-tp-cell {
    border: 1px solid #e8eaed;
    background: #fff;
    border-radius: 6px;
    corner-shape: squircle;
    font-size: 12px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    padding: 6px 4px;
    min-height: 32px;
    line-height: 1.2;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-cell:hover,
.oparo-a11y-tp-popover .oparo-a11y-tp-cell:focus {
    background: #e8f0fe;
    outline: none;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-cell.is-selected {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-field {
    margin-top: 4px;
}
.oparo-a11y-tp-popover .oparo-a11y-tp-foot {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8eaed;
}
.oparo-a11y-tp-wrap {
    display: inline-flex;
    align-items: stretch;
    gap: 6px;
    max-width: 100%;
}
.oparo-a11y-tp-wrap > input[type="time"] {
    flex: 1 1 auto;
    min-width: 0;
}
.oparo-a11y-tp-wrap .oparo-a11y-tp-trigger {
    flex: 0 0 auto;
    padding-left: 10px;
    padding-right: 10px;
}

