/*
 * DAREF V2.1
 * GLOBAL DATE FIELD INTERACTION
 *
 * FINAL SINGLE DATE ICON STANDARD
 * ============================================
 *
 * Keep:
 *   - Browser-native Date calendar icon
 *   - Manual Date typing
 *   - Existing input design
 *   - Existing Date Picker behaviour
 *
 * Remove:
 *   - Second/custom calendar icon
 *
 * No other form styling is changed here.
 */


/*
 * Date fields remain normal browser Date inputs.
 *
 * Do NOT use appearance:none because that can remove the
 * browser-native calendar indicator that we want to retain.
 */
input[type="date"] {
    cursor:
        text;
}


/*
 * Keep Chrome / Chromium / Edge / Safari native icon visible.
 */
input[type="date"]::-webkit-calendar-picker-indicator {
    display:
        block !important;

    opacity:
        1 !important;

    visibility:
        visible !important;

    pointer-events:
        auto !important;

    cursor:
        pointer !important;
}


/*
 * Preserve normal Date editing.
 */
input[type="date"].dv21-typing-enabled {
    cursor:
        text;
}


/*
 * ============================================================
 * REMOVE ALL DAREF / LEGACY SECOND DATE ICONS
 * ============================================================
 */

.dv21-calendar-trigger,
.date-calendar-trigger,
.date-picker-trigger,
.calendar-trigger,
[data-calendar-trigger],
[data-date-trigger] {
    display:
        none !important;

    visibility:
        hidden !important;

    opacity:
        0 !important;

    pointer-events:
        none !important;
}


/*
 * Extra protection for older wrappers.
 */
.dv21-field-shell
.dv21-calendar-trigger,

.dv21-field-shell
.date-calendar-trigger,

.dv21-field-shell
.date-picker-trigger,

.dv21-field-shell
.calendar-trigger,

.dv21-field-shell
[data-calendar-trigger],

.dv21-field-shell
[data-date-trigger] {
    display:
        none !important;

    visibility:
        hidden !important;

    opacity:
        0 !important;

    pointer-events:
        none !important;
}


/*
 * Keep a legacy shell harmless if it already exists in markup.
 * It must not change Date field dimensions or behaviour.
 */
.dv21-field-shell {
    position:
        relative;

    display:
        block;

    width:
        100%;
}


/*
 * Do not leave space reserved for the deleted second button.
 */
.dv21-field-shell
input[type="date"] {
    width:
        100%;
}


/*
 * Disabled fields remain disabled normally.
 */
input[type="date"]:disabled::-webkit-calendar-picker-indicator {
    cursor:
        not-allowed !important;
}


/*
 * FINAL:
 * One Date field = one native browser calendar icon.
 */
