/*
 * Date fields (public forms).
 *
 * Makes it obvious a date input opens a calendar: a calendar icon on the right and a pointer
 * cursor across the whole field. date-field.js adds the --scripted modifier where it can open the
 * picker from a click anywhere; without it the browser's own indicator stays visible and does the
 * job, so the field is never left with no way to open a calendar.
 */

.date-field {
    padding-right: 42px;
    /* Calendar glyph, inlined so the affordance never waits on another request. */
    background-image: 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='%23707070' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
}

.date-field:hover {
    background-image: 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='%230a0a0a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

/* The whole field opens the calendar, so it should not look like a plain text box. */
.date-field--scripted {
    cursor: pointer;
}

/*
 * WebKit and Blink draw their own picker button on top of the icon above. It is only hidden once
 * the script has taken over opening the calendar, so there is always exactly one way in.
 */
.date-field--scripted::-webkit-calendar-picker-indicator {
    opacity: 0;
}
