/* MegaMind futuristic date / datetime picker */
input[type="date"].mm-date-enhanced,
input[type="datetime-local"].mm-date-enhanced {
    color-scheme: dark;
    position: relative;
    cursor: pointer;
    min-height: 2.5rem;
    background-color: rgb(15 23 42 / 0.95);
    background-image:
        linear-gradient(165deg, rgba(34, 211, 238, 0.08), rgba(15, 23, 42, 0.9)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2322d3ee' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 0.85rem center;
    background-size: auto, 1.1rem;
    padding-right: 2.75rem !important;
    border-color: rgba(34, 211, 238, 0.35) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(34, 211, 238, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    /* Keep ISO value for forms; browsers may still show locale empty placeholder */
    color: #f8fafc;
}

input[type="date"].mm-date-enhanced:hover,
input[type="datetime-local"].mm-date-enhanced:hover,
input[type="date"].mm-date-enhanced:focus,
input[type="datetime-local"].mm-date-enhanced:focus {
    border-color: rgba(34, 211, 238, 0.65) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(34, 211, 238, 0.25),
        0 0 28px rgba(34, 211, 238, 0.15);
    outline: none;
}

/* Hide native calendar icon — custom popup handles picking */
input[type="date"].mm-date-enhanced::-webkit-calendar-picker-indicator,
input[type="datetime-local"].mm-date-enhanced::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

input[type="date"].mm-date-enhanced::-webkit-datetime-edit,
input[type="datetime-local"].mm-date-enhanced::-webkit-datetime-edit {
    color: #f8fafc;
}

input[type="date"].mm-date-enhanced:not(:valid)::-webkit-datetime-edit,
input[type="date"].mm-date-enhanced[value=""]::-webkit-datetime-edit {
    color: #94a3b8;
}

.mm-dp-pop {
    position: fixed;
    z-index: 9999;
    width: min(20.5rem, calc(100vw - 1.5rem));
    padding: 0.85rem;
    border-radius: 1.25rem;
    background:
        linear-gradient(165deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96)),
        radial-gradient(120% 80% at 10% 0%, rgba(34, 211, 238, 0.18), transparent 55%),
        radial-gradient(90% 70% at 100% 100%, rgba(168, 85, 247, 0.12), transparent 50%);
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 18px 40px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(34, 211, 238, 0.12);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    color: #e2e8f0;
    font-size: 0.875rem;
    animation: mm-dp-in 0.18s ease-out;
}

@keyframes mm-dp-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mm-dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mm-dp-title {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: #67e8f9;
    text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.mm-dp-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25));
    color: #a5f3fc;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px rgba(0, 0, 0, 0.35);
}

.mm-dp-nav:hover {
    border-color: rgba(34, 211, 238, 0.45);
    color: #fff;
}

.mm-dp-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
    margin-bottom: 0.35rem;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.mm-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.mm-dp-day {
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mm-dp-day:hover {
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.1);
    color: #fff;
}

.mm-dp-day.is-muted {
    color: #475569;
}

.mm-dp-day.is-today {
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.55);
    color: #e9d5ff;
}

.mm-dp-day.is-selected {
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.95), rgba(8, 145, 178, 0.9));
    color: #041016;
    font-weight: 700;
    border-color: rgba(165, 243, 252, 0.8);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}

.mm-dp-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.mm-dp-foot button {
    border: 0;
    background: transparent;
    color: #67e8f9;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
}

.mm-dp-foot button:hover {
    color: #fff;
}

.mm-dp-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.mm-dp-time label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.mm-dp-time input[type="time"] {
    flex: 1;
    border-radius: 0.75rem;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: rgba(2, 6, 23, 0.75);
    color: #e2e8f0;
    padding: 0.45rem 0.65rem;
}

/* Password reveal */
.mm-pass-wrap {
    position: relative;
}

.mm-pass-wrap input[type="password"],
.mm-pass-wrap input[type="text"].mm-pass-visible {
    padding-right: 2.75rem !important;
}

.mm-pass-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    z-index: 2;
}

.mm-pass-toggle:hover,
.mm-pass-toggle[aria-pressed="true"] {
    color: #67e8f9;
}

@media (prefers-reduced-motion: reduce) {
    .mm-dp-pop { animation: none; }
}
