/**
 * Lithuanian Phone Input Styles
 * 
 * Stiliai telefono numerio įvedimo laukui su validacija.
 * Naudojama su phone-lt.js
 */

/* ============================================================
   Phone Input Base Styles
   ============================================================ */

/* Phone mask input - inherit styles from other inputs */
.phone-mask {
    /* Inherit font from parent - same as other inputs */
    font-family: inherit;
    font-size: inherit;
}

/* ============================================================
   Validation States
   ============================================================ */

/* Error state */
.phone-mask.is-invalid,
input.phone-mask[aria-invalid="true"] {
    border-color: var(--cError) !important;
    background-color: #fff8f8;
}

.phone-mask.is-invalid:focus,
input.phone-mask[aria-invalid="true"]:focus {
    border-color: var(--cError) !important;
    box-shadow: 0 0 0 3px rgba(196, 50, 10, 0.15);
    outline: none;
}

/* The one-page checkout sets `border: … !important` on every .form-control
   (ets-onepagecheckout-modern.css), which loads after this file and outranks
   the state above, so the invalid border needs checkout-level specificity to
   appear at all. phone-lt.js marks the field itself, outside the checkout's
   `.form-error` wrapper that gives the other fields their red border. */
#form_ets_onepagecheckout.ets-opc-modern .phone-mask.is-invalid {
    border-color: var(--cError) !important;
}

/* ============================================================
   Form Error Container Integration
   ============================================================ */

/* Hide parent form-error when phone-lt-error is visible */
.frn-input__bottom:has(.phone-mask.is-invalid)+.form-error {
    display: none;
}

/* ============================================================
   Mobile Keyboard Optimization
   ============================================================ */

/* Ensure proper display on iOS/Android */
.phone-mask {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent zoom on iOS when focusing input */
@media screen and (max-width: 768px) {
    .phone-mask {
        font-size: var(--fz-16)!important;
    }
}

/* ============================================================
   Checkout & Address Form Specific
   ============================================================ */

/* Checkout address form phone styling */
.js-address-form .phone-mask {
    width: 100%;
}

/* Consistent height with other form fields */
.frn-login__field .phone-mask {
    height: 48px;
    padding: 12px 16px;
}

/* ============================================================
   Admin Panel Styling (if needed)
   ============================================================ */

/* Admin phone input styling */
.adminproducts .phone-mask,
.adminorders .phone-mask,
#form_step1 .phone-mask {
    font-size: var(--fz-14);
    padding: 8px 12px;
    border-radius: 4px;
}

/* ============================================================
   Placeholder
   ============================================================ */

.phone-mask::placeholder {
    color: #adb5bd;
    opacity: 1;
}

.phone-mask:focus::placeholder {
    color: #ced4da;
}

/* ============================================================
   Accessibility
   ============================================================ */

/* Focus visible for keyboard navigation */
.phone-mask:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .phone-mask.is-invalid {
        border-width: 2px;
    }

    .phone-lt-error {
        font-weight: bold;
    }
}