/* ==========================================================
   Shared DOB Numpad Component
   Phone-friendly rectangular numpad + DOB field styling.
   Kiosk pages override to circular keys in their own <style>.
   Used by: patient_registration, patient/verify, kiosk pages
   ========================================================== */

/* DOB field container */
.dob-display-container {
    background: #f5f5f7;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
}

.dob-fields {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
}

.dob-field {
    text-align: center;
}

.dob-label {
    display: block;
    font-size: 0.7rem;
    color: #86868b;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.dob-field.active .dob-label {
    color: var(--accent, #007aff);
}

.dob-input {
    width: 68px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    padding: 10px 6px;
    height: 54px;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #1d1d1f;
    letter-spacing: 1px;
    -webkit-appearance: none;
    outline: none;
}

.dob-input.dob-input-year {
    width: 90px;
}

.dob-input:focus,
.dob-input.active-field {
    border-color: var(--accent, #007aff);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb, 0, 122, 255), 0.1);
}

.dob-input.is-valid {
    border-color: #34c759;
}

.dob-input.is-invalid {
    border-color: #ff3b30;
}

.dob-separator {
    font-size: 1.75rem;
    font-weight: 300;
    color: #c7c7cc;
    padding-bottom: 10px;
}

/* Error and validation feedback */
.error-msg {
    text-align: center;
    font-size: 0.9rem;
    color: #ff3b30;
    padding: 0.75rem 1rem;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 12px;
    margin-bottom: 1rem;
    display: none;
}

.error-msg.show {
    display: block;
}

.validation-feedback {
    text-align: center;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.validation-feedback.info {
    color: #86868b;
}

.validation-feedback.success {
    color: #34c759;
    background: rgba(52, 199, 89, 0.1);
}

/* Numpad grid — phone-friendly rectangular keys by default */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin: 0 auto;
}

.num-key {
    border: none;
    border-radius: 14px;
    font-size: 1.75rem;
    font-weight: 500;
    padding: 14px 0;
    background: #f5f5f7;
    color: #1d1d1f;
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    will-change: transform;
}

.num-key:hover {
    background: #e8e8ed;
}

.num-key:active,
.num-key.pressed {
    background: #d1d1d6;
    transform: scale(0.95);
}

.num-key.zero {
    grid-column: span 2;
}

.num-key.delete {
    background: transparent;
    color: var(--accent, #007aff);
    font-size: 1.25rem;
}

.num-key.delete:hover {
    background: rgba(var(--accent-rgb, 0, 122, 255), 0.1);
}

.num-key.delete:active {
    background: rgba(var(--accent-rgb, 0, 122, 255), 0.15);
}

/* Shake animation for validation errors */
@keyframes dob-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake-animation {
    animation: dob-shake 0.5s ease;
}

/* Responsive sizing for larger screens */
@media (min-width: 500px) {
    .dob-input {
        width: 78px;
        height: 64px;
        font-size: 2rem;
    }

    .dob-input.dob-input-year {
        width: 100px;
    }

    .numpad {
        gap: 10px;
    }

    .num-key {
        font-size: 1.85rem;
    }
}

@media (min-width: 768px) {
    .dob-input {
        width: 85px;
        height: 70px;
        font-size: 2.25rem;
    }

    .dob-input.dob-input-year {
        width: 110px;
    }
}
