:root {
    --wfa-primary: #0d6efd;
    --wfa-primary-hover: #0b5ed7;
    --wfa-bg: #ffffff;
    --wfa-text: #212529;
    --wfa-border: #dee2e6;
    --wfa-error: #dc3545;
    --wfa-radius: 12px;
    --wfa-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* =========================================
   1. Modal & Overlay
   ========================================= */
.wfa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wfa-modal-overlay.wfa-show {
    opacity: 1;
    visibility: visible;
}

.wfa-modal-box {
    background: var(--wfa-bg);
    width: 100%;
    max-width: 400px;
    border-radius: var(--wfa-radius);
    box-shadow: var(--wfa-shadow);
    padding: 25px;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    margin: 15px;
    position: relative;
}

.wfa-modal-overlay.wfa-show .wfa-modal-box {
    transform: translateY(0);
}

.wfa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wfa-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.wfa-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    color: #888;
}

/* =========================================
   2. Inputs & Forms
   ========================================= */
.wfa-input-group {
    position: relative;
    margin-bottom: 20px;
}

.wfa-input {
    width: 100%;
    padding: 12px 15px 12px 40px; /* Space for icon */
    border: 1px solid var(--wfa-border);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    height: 50px;
    box-sizing: border-box;
}

.wfa-input:focus {
    border-color: var(--wfa-primary);
}

.wfa-label {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--wfa-bg);
    padding: 0 5px;
    color: #6c757d;
    transition: all 0.2s;
    pointer-events: none;
}

.wfa-input:focus ~ .wfa-label,
.wfa-input:not(:placeholder-shown) ~ .wfa-label {
    top: 0;
    font-size: 12px;
    color: var(--wfa-primary);
}

.wfa-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* OTP Inputs */
.wfa-otp-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 20px 0;
}

.wfa-otp-input {
    width: 100%;
    height: 50px;
    text-align: center;
    font-size: 20px;
    border: 1px solid var(--wfa-border);
    border-radius: 8px;
    outline: none;
}

.wfa-otp-input:focus {
    border-color: var(--wfa-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* =========================================
   3. Buttons & Loaders
   ========================================= */
.wfa-btn {
    width: 100%;
    padding: 12px;
    background: var(--wfa-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wfa-btn:hover {
    background: var(--wfa-primary-hover);
}

.wfa-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wfa-loader {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    animation: wfa-spin 1s linear infinite;
}

@keyframes wfa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.wfa-btn.wfa-loading .wfa-loader {
    display: inline-block;
}

.wfa-btn.wfa-loading .wfa-btn-text {
    display: none;
}

.wfa-resend-wrapper {
    margin-top: 20px;
    text-align: center;
}

.wfa-btn-resend {
    background: none;
    border: 1px solid var(--wfa-border);
    color: var(--wfa-text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.wfa-btn-resend:disabled {
    opacity: 0.6;
    cursor: default;
    border-color: #eee;
    color: #999;
}

.wfa-btn-resend:not(:disabled):hover {
    border-color: var(--wfa-primary);
    color: var(--wfa-primary);
    background: rgba(13, 110, 253, 0.05);
}

#wfa-timer {
    font-weight: bold;
    min-width: 40px;
    display: inline-block;
}

/* =========================================
   4. Messages & Utilities
   ========================================= */
.wfa-error-msg {
    color: var(--wfa-error);
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
    text-align: center;
}

.wfa-footer-text {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin-top: 15px;
}

/* =========================================
   5. Dropdowns (General & Mobile)
   ========================================= */
.wfa-dropdown {
    position: relative;
    display: inline-block;
}

.wfa-dropdown-toggle {
    background: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.wfa-login-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.wfa-dropdown .wfa-icon-user::after {
    content: "\f140" !important;
    font-family: dashicons !important;
    color: #ffffff;
}

div.header-btn {
    background-color: var(--bs-secondary);
    transition: all 0.15s ease-in-out;
    border-radius: var(--bs-border-radius);
    color: #fff;
    text-align: center;
    text-decoration: none;
}

/* --- Base Dropdown Menu --- */
.wfa-dropdown-menu {
    position: absolute;
    top: 110%; /* Default opens down */
    left: 0; /* Default aligns left (or adjust based on parent) */
    background: white;
    min-width: 200px;
    box-shadow: var(--wfa-shadow);
    border-radius: 8px;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 1000;
}

.wfa-dropdown.active .wfa-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Mobile Dropdown Override (Up & Right) --- */
.wfa-dropdown-mobile .wfa-dropdown-menu {
    top: auto; /* Disable top positioning */
    bottom: 115%; /* Push upwards */
    left: 0; /* Disable left alignment */
    right: auto; /* Align to the right edge */
    transform-origin: bottom right; /* Animation start point */
    margin-bottom: 5px;
}

/* --- Dropdown Items --- */
.wfa-dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    color: var(--wfa-text);
    text-decoration: none;
}

.wfa-dropdown-menu li a:hover {
    background: #f8f9fa;
}

.wfa-user-info {
    padding: 8px 20px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.wfa-dropdown-menu .dropdown-divider {
    height: 0;
    overflow: hidden;
    border-top: 1px solid #eee;
    opacity: 1;
}