/* Admin Styles for Authyo OTP for MetForm */
.authyo-settings-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.authyo-card-header {
    padding: 15px;
    border-bottom: 1px solid #ccd0d4;
    background: #fff;
}

.authyo-card-title {
    margin: 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.authyo-card-body {
    padding: 20px;
}

.authyo-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.authyo-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #23282d;
}

.authyo-field-input {
    border-color: #8c8f94;
    box-shadow: none;
    border-radius: 4px;
    padding: 6px 10px;
}

/* Radio Group */
.authyo-radio-group {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.authyo-radio-btn {
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.authyo-radio-btn:hover {
    background: #f6f7f7;
    border-color: #999;
}

.authyo-radio-btn.active {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #2271b1;
    font-weight: 500;
}

.authyo-radio-btn input {
    margin: 0;
}

/* Checkbox Box */
.authyo-checkbox-box {
    border: 1px solid #2271b1;
    background: #f0f6fc;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.authyo-checkbox-box label {
    font-weight: 500;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cache Info Styles */
.authyo-cache-info {
    background: #f9fafb;
    border-left: 4px solid #2271b1;
    padding: 1px 20px;
    margin: 20px 0;
}

.authyo-cache-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.authyo-cache-row:last-child {
    border-bottom: none;
}

.authyo-cache-label {
    font-weight: 600;
    color: #1d2327;
}

.authyo-cache-value {
    color: #50575e;
}

.authyo-cache-value.status-cached {
    color: #008a20;
    font-weight: 500;
}

.authyo-refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #2271b1;
    background: #fff;
    color: #2271b1;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.authyo-refresh-btn:hover {
    background: #f0f6fc;
}

.authyo-refresh-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.authyo-refresh-btn.refreshing {
    opacity: 0.7;
    cursor: not-allowed;
}

.authyo-refresh-feedback-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.authyo-refresh-msg {
    color: #008a20;
    font-weight: 500;
    font-size: 13px;
    transition: opacity 0.5s ease;
}

.authyo-refresh-msg.fade-out {
    opacity: 0;
}

.authyo-otp-mf-tab {
    display: none;
}

.authyo-otp-mf-tab.active {
    display: block;
}

.nav-tab-wrapper {
    margin-bottom: 20px;
}

/* ========================================================================
   METHODS TAB — 2-column grid layout
   ======================================================================== */

.authyo-methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}

.authyo-methods-grid .authyo-settings-card {
    margin: 0;
    height: 100%;
    box-sizing: border-box;
}

/* Channel checkboxes grid */
.authyo-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.authyo-channel-option {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.authyo-channel-option:hover {
    border-color: #2271b1;
    background: #f6f7f7;
}

.authyo-channel-option input[type="checkbox"] {
    margin: 0 8px 0 0;
    flex-shrink: 0;
}

.authyo-channel-option:has(input[type="checkbox"]:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

.authyo-channel-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
}

.authyo-channel-option:has(input[type="checkbox"]:checked) .authyo-channel-label {
    color: #2271b1;
}

.authyo-channel-label .dashicons {
    font-size: 17px;
    width: 17px;
    height: 17px;
    color: #646970;
}

.authyo-channel-option:has(input[type="checkbox"]:checked) .authyo-channel-label .dashicons {
    color: #2271b1;
}

/* Radio button group */
.authyo-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.authyo-radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    transition: all 0.2s ease;
}

.authyo-radio-option:hover {
    border-color: #2271b1;
    background: #f6f7f7;
}

.authyo-radio-option input[type="radio"] {
    margin: 0;
}

.authyo-radio-option:has(input[type="radio"]:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #2271b1;
}

/* Checkbox box wrapper */
.authyo-checkbox-box {
    padding: 10px 14px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s;
}

.authyo-checkbox-box:has(input:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

/* API Credentials 3-column grid */
.authyo-api-credentials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.authyo-api-credentials-grid .authyo-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.authyo-api-credentials-grid .authyo-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 0;
}

@media (max-width: 782px) {
    .authyo-api-credentials-grid {
        grid-template-columns: 1fr;
    }
}

/* OTP Defaults 2x2 grid */
.authyo-otp-defaults-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.authyo-otp-defaults-grid .authyo-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.authyo-otp-defaults-grid .authyo-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 0;
}

.authyo-otp-defaults-grid .authyo-field-label .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #2271b1;
}

.authyo-field-input--full {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #fff;
    color: #1d2327;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.authyo-field-input--full:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
    outline: none;
}

.authyo-otp-defaults-grid .description {
    font-size: 12px;
    color: #646970;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 782px) {
    .authyo-otp-defaults-grid {
        grid-template-columns: 1fr;
    }
}

/* Country config card spans full width */
.authyo-methods-grid .authyo-country-config-card {
    grid-column: 1 / -1;
}

/* Voice call notice */
.authyo-voice-notice {
    background: #fff3cd;
    padding: 10px 14px;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-weight: 500;
    font-size: 13px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsive */
@media (max-width: 1024px) {
    .authyo-methods-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    .authyo-channels-grid {
        grid-template-columns: 1fr 1fr;
    }
    .authyo-methods-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes authyo-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-icon {
    animation: authyo-spin 1s linear infinite;
}

.authyo-help-text {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #646970;
    font-size: 13px;
}

.authyo-help-text .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.authyo-help-text a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.authyo-help-text a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Entries Table */
.authyo-entries-table th {
    font-weight: 600;
}

.authyo-entry-data-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
}

.authyo-entry-data-list li {
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 4px;
}

.authyo-entry-data-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.authyo-entry-data-list strong {
    color: #2c3338;
    min-width: 80px;
    display: inline-block;
}

.authyo-entries-table .button-link-delete {
    color: #b32d2e;
    padding: 0;
    min-height: auto;
    line-height: 1;
}

.authyo-entries-table .button-link-delete:hover {
    color: #d63638;
}

.authyo-entries-table .dashicons-trash {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* === Lead Management status badges === */
.authyo-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
}

.authyo-status-verified {
    background: #edfaef;
    color: #00a32a;
    border: 1px solid #00a32a;
}

.authyo-status-other {
    background: #fef7e7;
    color: #996800;
    border: 1px solid #dba617;
}

.authyo-status-unverified {
    background: #fcf0f1;
    color: #b32d2e;
    border: 1px solid #d63638;
}

.authyo-leads-table td {
    vertical-align: top;
}

.authyo-delete-lead {
    color: #b32d2e !important;
    border-color: #d63638 !important;
}

.authyo-delete-lead:hover {
    background: #fcf0f1 !important;
    color: #b32d2e !important;
}

/* =========================================================================
   COUNTRY DROPDOWN CONFIGURATION
   ========================================================================= */

.authyo-country-config-card {
    overflow: hidden;
}

.authyo-country-modes {
    padding: 20px;
}

.authyo-section-label {
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    font-size: 13px;
    font-weight: 500;
    color: #3c434a;
}

.authyo-mode-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 782px) {
    .authyo-mode-cards {
        grid-template-columns: 1fr;
    }
}

.authyo-mode-card {
    position: relative;
    cursor: pointer;
    display: block;
    margin: 0;
}

.authyo-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.authyo-mode-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
}

.authyo-mode-card:hover .authyo-mode-card-inner {
    border-color: #a7c5e2;
    background: #f8fbff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(34, 113, 177, 0.08);
}

.authyo-mode-active .authyo-mode-card-inner,
.authyo-mode-card input:checked + .authyo-mode-card-inner {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 1px #2271b1, 0 3px 8px rgba(34, 113, 177, 0.12);
}

.authyo-mode-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #50575e;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.authyo-mode-active .authyo-mode-icon,
.authyo-mode-card input:checked + .authyo-mode-card-inner .authyo-mode-icon {
    color: #2271b1;
}

.authyo-mode-title {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
}

.authyo-mode-desc {
    font-size: 11px;
    color: #757575;
    line-height: 1.4;
}

.authyo-country-panel {
    border-top: 1px solid #e0e4e8;
    animation: authyo-slide-down 0.3s ease;
}

@keyframes authyo-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.authyo-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #e0e4e8;
}

.authyo-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.authyo-panel-count {
    font-size: 12px;
    background: #2271b1;
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.authyo-country-search-wrap {
    position: relative;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.authyo-search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0a5aa;
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    z-index: 2;
    pointer-events: none;
}

input[type="text"].authyo-country-search-input,
.authyo-country-search-input {
    width: 100%;
    padding: 10px 40px 10px 50px;
    border: 1px solid #e0e4e8;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    min-height: 0;
    background: #f8f9fa;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

input[type="text"].authyo-country-search-input:focus,
.authyo-country-search-input:focus {
    border-color: #2271b1;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.authyo-search-clear {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    background: #a0a5aa;
    border: none;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
    z-index: 2;
}

.authyo-search-clear:hover {
    background: #d63638;
}

.authyo-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 20px;
    min-height: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.authyo-selected-tags:empty {
    padding: 8px 20px;
}

.authyo-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    background: linear-gradient(135deg, #e8f4fd 0%, #dbeefa 100%);
    border: 1px solid #b8daef;
    border-radius: 14px;
    font-size: 12px;
    color: #1d5a8a;
    font-weight: 500;
}

.authyo-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: rgba(34, 113, 177, 0.15);
    border-radius: 50%;
    color: #2271b1;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
}

.authyo-tag-remove:hover {
    background: #d63638;
    color: #fff;
}

.authyo-country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e4e8;
}

.authyo-country-grid::-webkit-scrollbar {
    width: 6px;
}

.authyo-country-grid::-webkit-scrollbar-thumb {
    background: #c0c5ca;
    border-radius: 3px;
}

.authyo-country-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    margin: 0;
}

.authyo-country-checkbox:hover {
    background: #f0f6fc;
}

.authyo-country-checkbox.authyo-country-checked {
    background: #e8f4fd;
}

.authyo-country-checkbox input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    accent-color: #2271b1;
    cursor: pointer;
}

.authyo-country-checkbox-name {
    font-size: 13px;
    color: #1d2327;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.authyo-country-checkbox-dial {
    font-size: 11px;
    color: #757575;
    flex-shrink: 0;
}

.authyo-country-checkbox.authyo-country-hidden {
    display: none;
}

.authyo-country-no-results {
    padding: 24px 20px;
    text-align: center;
    color: #757575;
    font-size: 13px;
    font-style: italic;
}

.authyo-country-empty {
    padding: 24px 20px;
    text-align: center;
    color: #757575;
    font-size: 13px;
    grid-column: 1 / -1;
}

.authyo-single-select-wrap {
    padding: 20px;
}

.authyo-single-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e4e8;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
    cursor: pointer;
    appearance: auto;
    transition: border-color 0.2s;
}

.authyo-single-select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}
