/* Authyo OTP Frontend Styles */

.authyo-otp-container {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #e2e4e7;
    background: #fcfcfc;
    border-radius: 4px;
    position: relative;
    border-left: 4px solid #25d366;
    /* Default Phone Green - matching sample */
}

/* Specific border colors per type if injected with distinct IDs */
#authyo-ui-email {
    border-left-color: #0073aa;
}

.authyo-otp-container * {
    box-sizing: border-box;
}

/* Steps */
.authyo-step-send,
.authyo-step-verify {
    width: 100%;
}

.authyo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.authyo-btn {
    padding: 8px 16px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: normal;
    transition: background 0.2s;
}

.authyo-btn:hover {
    background-color: #135e96;
}

.authyo-btn:disabled,
.authyo-btn.disabled {
    background-color: #a7aaad !important;
    cursor: not-allowed;
    color: #fff !important;
}

.authyo-otp-input {
    padding: 8px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

/* Messages */
.authyo-message {
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

.authyo-message.success {
    color: #00a32a;
}

.authyo-message.error {
    color: #d63638;
}

/* Resend & Timer */
.authyo-resend-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.authyo-timer {
    color: #646970;
    font-variant-numeric: tabular-nums;
}

.authyo-btn-link {
    background: none;
    border: none;
    color: #2271b1;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.authyo-btn-link:hover {
    color: #135e96;
}

.authyo-btn-link:disabled {
    color: #a7aaad;
    text-decoration: none;
    cursor: default;
}

/* Fallback Options */
.authyo-fallback-options {
    padding-top: 10px;
    border-top: 1px dashed #dedede;
    font-size: 13px;
}

.authyo-fallback-link {
    display: inline-block;
    margin-right: 15px;
    color: #2271b1;
    text-decoration: none;
    border-bottom: 1px dotted #2271b1;
}

.authyo-fallback-link:hover {
    border-bottom-style: solid;
}

/* Success Banner */
.authyo-success-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    /* Blue left border */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.authyo-success-text {
    color: #008a20;
    /* Green text */
    font-weight: 500;
    font-size: 14px;
}

.authyo-btn-change {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
}

.authyo-btn-change:hover {
    background: #333;
}

/* === Country Selector Styles (Ported from Sample, renamed to authyo-) === */

/* Inline phone container - wraps country dropdown + phone field */
.authyo-phone-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    /* Center align with input */
    margin: 0;
    position: relative;
    width: 100%;
}

.authyo-country-selector-container {
    position: relative;
    flex: 0 0 140px;
    /* Adjusted width */
    max-width: 140px;
    margin-bottom: 0;
}

/* Phone field styling when integrated */
.authyo-phone-wrapper .forminator-input {
    flex: 1;
    min-width: 0;
    padding-left: 55px !important;
    /* Make room for prefix */
}

/* Visual prefix showing country code on phone field */
.authyo-phone-prefix {
    position: absolute;
    left: calc(140px + 20px);
    /* Width of selector + gap + padding */
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #444;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
    /* Above input */
    background: transparent;
}

.authyo-country-dropdown-wrapper {
    position: relative;
    display: block;
    cursor: pointer;
}

.authyo-country-search {
    width: 100%;
    padding: 8px 35px 8px 10px !important;
    /* Right padding for arrow/flag */
    font-size: 13px !important;
    border: 1px solid #c3c4c7 !important;
    border-radius: 4px !important;
    background: white !important;
    cursor: pointer !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 40px;
    /* Match forminator height usually */
    line-height: normal !important;
}

.authyo-country-search:focus {
    border-color: #2271b1 !important;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.authyo-country-code-display {
    display: none;
    /* We show it as prefix inside phone input mostly, but can keep logic */
}

.authyo-dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 10px;
}

.authyo-country-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
    margin-top: 4px;
}

.authyo-country-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.authyo-country-item:hover,
.authyo-country-item.authyo-highlighted {
    background-color: #e2f0f9;
}

/* === Method Selector UI === */
.authyo-method-selector {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.authyo-method-selector-message {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 500;
    color: #3c434a;
}

.authyo-method-selector-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 600px) {
    .authyo-method-selector-buttons {
        grid-template-columns: 1fr;
    }
}

.authyo-method-selector-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    color: #2271b1;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.authyo-method-selector-btn:hover {
    background: #f0f6fc;
    border-color: #2271b1;
    color: #2271b1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.authyo-method-selector-btn:active {
    transform: translateY(0);
    box-shadow: none;
    background: #e5e5e5;
}

.authyo-method-selector-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #2271b1;
    /* Ensure icon matches text color */
}

.authyo-country-item.authyo-selected {
    background-color: #e7f3f8;
    font-weight: 500;
}

.authyo-country-flag {
    font-size: 14px;
}