/* ==========================================================================
   sender Frontend OTP Styles
   Matches WooCommerce Blocks checkout design language
   ========================================================================== */

.hoktech-otp-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px;
    margin: 0 0 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.hoktech-otp-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    line-height: 1.4;
}

.hoktech-otp-description {
    color: #757575;
    font-size: 14px;
    margin: 0 0 16px;
    line-height: 1.5;
}

.hoktech-otp-btn {
    background: #1e1e1e !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
}

.hoktech-otp-btn:hover {
    background: #333 !important;
}

.hoktech-otp-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #757575 !important;
}

.hoktech-otp-input-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
}

.hoktech-otp-input {
    flex: 1;
    padding: 12px 16px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    text-align: center !important;
    letter-spacing: 4px !important;
    font-weight: 600 !important;
    max-width: 180px;
    direction: ltr;
    color: #1e1e1e !important;
    background: #fff !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
}

.hoktech-otp-input:focus {
    border-color: #1e1e1e !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #1e1e1e !important;
}

.hoktech-otp-verify-btn {
    background: #1e1e1e !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    transition: background 0.2s ease !important;
}

.hoktech-otp-verify-btn:hover {
    background: #333 !important;
}

.hoktech-otp-status {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
}

.hoktech-otp-verified {
    border-color: #4ab866 !important;
    background: #f0faf3 !important;
}

/* Hide inputs/buttons with animation when verified */
.hoktech-otp-verified .hoktech-otp-actions,
.hoktech-otp-verified .hoktech-otp-input-group,
.hoktech-otp-verified #hoktech-otp-input-section,
.hoktech-otp-verified .hoktech-otp-timer,
.hoktech-otp-verified .hoktech-otp-description {
    animation: hoktechSlideUp 0.4s ease forwards;
    pointer-events: none;
}

@keyframes hoktechSlideUp {
    0% {
        opacity: 1;
        max-height: 100px;
        margin-top: 16px;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        padding: 0;
        transform: translateY(-10px);
        overflow: hidden;
    }
}

/* Success banner */
.hoktech-otp-success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #e8f5e9;
    border: 1px solid #4ab866;
    border-radius: 4px;
    padding: 14px 20px;
    margin-top: 16px;
    animation: hoktechFadeIn 0.5s ease 0.3s both;
}

.hoktech-otp-success-banner .hoktech-success-icon {
    width: 28px;
    height: 28px;
    background: #4ab866;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    font-weight: bold;
}

.hoktech-otp-success-banner .hoktech-success-text {
    font-size: 15px;
    font-weight: 600;
    color: #2e7d32;
}

@keyframes hoktechFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Country Code Selector Styles
   Clean, responsive, RTL-compatible
   ========================================================================== */

.hoktech-phone-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    direction: ltr;
}

/* The country button (flag + dial code + arrow) */
.hoktech-country-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: #f8f8f8;
    border: 1px solid #d0d0d0;
    border-right: none;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
    min-height: 48px;
    flex-shrink: 0;
}

.hoktech-country-btn:hover {
    background: #f0f0f0;
    border-color: #b0b0b0;
}

.hoktech-country-btn:focus {
    outline: none;
    border-color: #1e1e1e;
    box-shadow: 0 0 0 1px #1e1e1e;
    z-index: 2;
}

.hoktech-country-flag {
    font-size: 20px;
    line-height: 1;
}

.hoktech-country-dial {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.3px;
}

.hoktech-country-arrow {
    color: #999;
    flex-shrink: 0;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

/* Make the phone input have no left border-radius when selector is present */
.hoktech-phone-wrapper input[type="tel"],
.hoktech-phone-wrapper input[type="text"],
.hoktech-phone-wrapper input[name*="phone"] {
    border-radius: 0 4px 4px 0 !important;
    border-left: 1px solid #d0d0d0 !important;
    flex: 1;
    min-width: 0;
}

/* Dropdown container */
.hoktech-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 99999;
    margin-top: 4px;
    overflow: hidden;
    animation: hoktechDropdownIn 0.15s ease;
}

@keyframes hoktechDropdownIn {
    0% {
        opacity: 0;
        transform: translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search input inside dropdown */
.hoktech-country-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.hoktech-country-search {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    background: #fff !important;
    color: #333 !important;
    direction: rtl !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease !important;
    outline: none !important;
}

.hoktech-country-search:focus {
    border-color: #1e1e1e !important;
    box-shadow: 0 0 0 1px #1e1e1e !important;
}

.hoktech-country-search::placeholder {
    color: #aaa;
}

/* Country list */
.hoktech-country-list {
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hoktech-country-list::-webkit-scrollbar {
    width: 6px;
}

.hoktech-country-list::-webkit-scrollbar-track {
    background: transparent;
}

.hoktech-country-list::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.hoktech-country-list::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Individual country item */
.hoktech-country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s ease;
    border-bottom: 1px solid #f5f5f5;
    direction: ltr;
}

.hoktech-country-item:last-child {
    border-bottom: none;
}

.hoktech-country-item:hover,
.hoktech-country-item.hoktech-country-active {
    background: #f0f7ff;
}

.hoktech-country-item.hoktech-country-selected {
    background: #e8f5e9;
    font-weight: 600;
}

.hoktech-ci-flag {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.hoktech-ci-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    direction: rtl;
    text-align: right;
}

.hoktech-ci-dial {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    flex-shrink: 0;
    direction: ltr;
}

/* Empty state */
.hoktech-country-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    direction: rtl;
}

/* ========== Responsive Styles ========== */

@media (max-width: 768px) {
    .hoktech-phone-wrapper {
        flex-direction: row;
    }

    .hoktech-country-btn {
        padding: 0 8px;
        gap: 4px;
        min-height: 44px;
    }

    .hoktech-country-flag {
        font-size: 18px;
    }

    .hoktech-country-dial {
        font-size: 13px;
    }

    .hoktech-country-dropdown {
        width: 100%;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 0 0 8px 8px;
    }

    .hoktech-country-list {
        max-height: 220px;
    }

    .hoktech-country-item {
        padding: 12px 14px;
    }

    .hoktech-ci-flag {
        font-size: 18px;
    }

    .hoktech-ci-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hoktech-country-btn {
        padding: 0 6px;
        gap: 3px;
    }

    .hoktech-country-dial {
        font-size: 12px;
    }

    .hoktech-country-arrow {
        display: none;
    }

    .hoktech-country-search {
        font-size: 16px !important; /* Prevent iOS zoom */
    }
}
