/* Plugin: InstructorPro Suite | File Version: 2016v3 */
/* ===========================================================
   EZ2D Frontend 2FA Authentication CSS
   Complete with Modal Card Styling
=========================================================== */

:root {
    --ez2d-2fa-accent: #2563eb;
    --ez2d-2fa-accent-deep: #1d4ed8;
    --ez2d-2fa-ink: #0d4b6e;
    --ez2d-2fa-ink-soft: #43657d;
    --ez2d-2fa-surface: #ffffff;
    --ez2d-2fa-backdrop: rgba(9, 30, 46, 0.56);
    --ez2d-2fa-border: #d7e2ea;
}

/* Page Container */
body.page-template .ez2d-auth-card {
    max-width: 480px;
    width: min(92vw, 440px);
    margin: 80px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ez2d-auth-card {
    position: relative;
}

/* Tabs */
.ez2d-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.ez2d-auth-tabs button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.ez2d-auth-tabs button:hover {
    color: #0073aa;
    background: rgba(0, 115, 170, 0.05);
}

.ez2d-auth-tabs button.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.ez2d-auth-tabs button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Panels */
.ez2d-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ez2d-panel.hidden {
    display: none !important;
}

/* Form Inputs */
.ez2d-panel input[type="text"],
.ez2d-panel input[type="email"],
.ez2d-panel input[type="password"],
.ez2d-password-box input[type="password"],
.ez2d-password-box input[type="text"],
.ez2d-signup-final input[type="password"],
.ez2d-signup-final input[type="text"] {
    width: min(100%, 360px);
    margin: 0 auto;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ez2d-panel input:focus,
.ez2d-password-box input:focus,
.ez2d-signup-final input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Error State */
input.ez2d-error {
    border-color: #dc3232 !important;
    background: #fff5f5 !important;
}

.ez2d-inline-error {
    color: #dc3232;
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Password Wrapper */
.ez2d-pass-wrap {
    position: relative;
    width: min(100%, 360px);
    margin: 0 auto;
}

.ez2d-pass-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ez2d-pass-toggle:hover {
    color: #0073aa;
}

/* Forgot Link */
.ez2d-forgot-link {
    text-align: center;
    margin: -10px 0 0 0;
}

.ez2d-forgot-link a {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.ez2d-forgot-link a:hover {
    text-decoration: underline;
}

.ez2d-remember-device {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px auto 2px;
    width: min(100%, 360px);
    font-size: 14px;
    color: #2c3e50;
}

.ez2d-remember-device input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1e6efb;
}

/* Auth message banners under password */
.ez2d-auth-message-slot {
    width: min(100%, 360px);
    margin: 6px auto 0;
    text-align: center;
    min-height: 0;
}

.ez2d-auth-banner {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
}

.ez2d-auth-banner--success,
.ez2d-auth-banner--info {
    background: #e8f8ee;
    color: #1f7a3a;
    border: 1px solid #bfe6c8;
}

.ez2d-auth-banner--error {
    background: #fde9e9;
    color: #b42318;
    border: 1px solid #f6c5c5;
}

/* Buttons */
.ez2d-auth-card .ez2d-btn-primary {
    width: min(100%, 360px);
    margin: 0 auto;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ez2d-btn-primary .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* 2FA Box */
.ez2d-2fa-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ez2d-2fa-box.hidden {
    display: none !important;
}

.ez2d-2fa-box > p:first-child {
    text-align: center;
    color: #333;
    font-size: 14px;
    margin: 0;
}

.ez2d-2fa-instructions {
    text-align: center;
    background: #e8f8ee;
    color: #1f7a3a;
    border: 1px solid #bfe5c9;
    border-radius: 999px;
    padding: 8px 14px;
    margin: 0 auto;
    display: inline-block;
    font-weight: 600;
}

.ez2d-2fa-banner {
    display: inline-block;
    margin: 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e7f6ed;
    color: #146c2e;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #bfe3c9;
    text-align: center;
}

.ez2d-2fa-banner.is-error {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* 2FA Inputs */
.ez2d-2fa-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 320px;
    margin: 0 auto;
}

.ez2d-2fa-inputs input {
    width: clamp(40px, 12vw, 50px);
    height: clamp(48px, 14vw, 60px);
    text-align: center;
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ez2d-2fa-inputs input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Local debug code (centered under 2FA inputs) */
.ez2d-2fa-debug {
    text-align: center;
    font-weight: 600;
    color: #1f7a3a;
    font-size: 14px;
}

/* Resend Area */
.ez2d-resend-area {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0;
}

.ez2d-resend-timer {
    display: inline-block;
}

.ez2d-btn-link {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
}

.ez2d-btn-link:hover {
    color: #005a87;
}

.ez2d-btn-link.hidden,
.ez2d-resend-timer.hidden {
    display: none !important;
}

/* Password Reset & Signup Final Boxes */
.ez2d-password-box,
.ez2d-signup-final {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Password fields + requirements grid */
.ez2d-pass-grid {
    position: relative;
    width: 360px;
    max-width: 100%;
    margin: 0 auto;
}

.ez2d-pass-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: none;
}

.ez2d-pass-fields .ez2d-pass-wrap {
    width: 100%;
    margin: 0;
}

/* Password strength meter (reset + signup) */
.ez2d-strength-wrap {
    position: absolute;
    left: calc(100% + 40px);
    top: 0;
    margin: 0;
    width: 260px;
    max-width: 260px;
}

/* Keep input styling consistent when toggled to text */
.ez2d-pass-wrap input {
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.ez2d-strength-bar {
    width: 100%;
    height: 32px;
    border-radius: 6px;
    background: #f1f1f1;
    border: 1px solid #c3c4c7;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #1d2327;
    line-height: 30px;
}

.ez2d-strength-bar[data-strength="very-weak"],
.ez2d-strength-bar[data-level="very-weak"] {
    background: #f6b3b3 !important;
    border-color: #d63638 !important;
}

.ez2d-strength-bar[data-strength="weak"],
.ez2d-strength-bar[data-level="weak"] {
    background: #fbd2a6 !important;
    border-color: #dba617 !important;
}

.ez2d-strength-bar[data-strength="medium"],
.ez2d-strength-bar[data-level="medium"] {
    background: #fbe3a4 !important;
    border-color: #dba617 !important;
}

.ez2d-strength-bar[data-strength="strong"],
.ez2d-strength-bar[data-level="strong"] {
    background: #c7f0c2 !important;
    border-color: #1a7f37 !important;
}

.ez2d-strength-bar[data-strength="mismatch"],
.ez2d-strength-bar[data-level="mismatch"] {
    background: #f6b3b3 !important;
    border-color: #d63638 !important;
}

input.ez2d-strength-very-weak,
input.ez2d-strength-weak,
input.ez2d-strength-medium,
input.ez2d-strength-strong,
input.ez2d-strength-mismatch {
    border-width: 2px;
    box-shadow: none !important;
}

input.ez2d-strength-very-weak,
input.ez2d-strength-mismatch {
    border-color: #d63638 !important;
}

input.ez2d-strength-weak,
input.ez2d-strength-medium {
    border-color: #dba617 !important;
}

input.ez2d-strength-strong {
    border-color: #1a7f37 !important;
}

/* Password requirements list */
.ez2d-pass-reqs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.ez2d-pass-reqs li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ez2d-pass-reqs li.met {
    color: #1f7a3a;
    font-weight: 600;
}

.ez2d-pass-req-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    color: #b42318;
    font-size: 12px;
    line-height: 1;
}

.ez2d-pass-reqs li.met .ez2d-pass-req-icon {
    border-color: #1f7a3a;
    color: #1f7a3a;
    background: #e8f8ee;
}

.ez2d-pass-match {
    font-size: 12px;
    margin-top: 6px;
    color: #b42318;
    min-height: 16px;
}

.ez2d-pass-match.is-error {
    display: block;
}

.ez2d-input-error {
    border-color: #b42318 !important;
    box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.15) !important;
}

.ez2d-password-box.hidden,
.ez2d-signup-final.hidden {
    display: none !important;
}

/* Already Logged In */
.ez2d-already-logged-in {
    text-align: center;
    padding: 20px;
}

.ez2d-already-logged-in h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.ez2d-already-logged-in p {
    color: #666;
    margin-bottom: 25px;
}

.ez2d-already-logged-in .ez2d-actions {
    display: flex;
    justify-content: center;
}

.ez2d-already-logged-in .ez2d-btn-primary {
    width: auto;
    min-width: 200px;
}

/* Loading Overlay */
.ez2d-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    --ez2d-spinner-size: 50px;
    --ez2d-spinner-border: 4px;
    --ez2d-spinner-track: #f3f3f3;
    --ez2d-spinner-head: #0073aa;
}


/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    body.page-template .ez2d-auth-card {
        margin: 40px 20px;
        padding: 30px 20px;
    }

    .ez2d-pass-grid {
        width: 100%;
    }

    .ez2d-pass-fields {
        max-width: 100%;
    }

    .ez2d-strength-wrap {
        position: static;
        width: 100%;
        max-width: none;
        margin-top: 8px;
    }
    
    .ez2d-auth-tabs button {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .ez2d-2fa-inputs {
        gap: 8px;
    }
}

/* Dark Background for Login Page */
body.page-template-default,
body.page-id-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alternative: If you want a simple solid color */
/* body.page-template-default {
    background: #f0f0f1;
} */






/* 2FA one-line override */
.ez2d-2fa-inputs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 4px !important;
    max-width: 200px !important;
    margin: 0 auto !important;
}

.ez2d-2fa-inputs input {
    flex: 0 0 auto !important;
    width: 28px !important;
    height: 36px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}

@media (max-width: 600px) {
    .ez2d-2fa-inputs {
        gap: 3px !important;
        max-width: 190px !important;
    }
    .ez2d-2fa-inputs input {
        width: 26px !important;
        height: 34px !important;
        font-size: 13px !important;
    }
    .ez2d-2fa-box > p:first-child {
        font-size: 12px !important;
    }
}

/* ==========================================================================
   Modal 2FA Override
   ========================================================================== */
body.ez2d-2fa-modal-open {
    overflow: hidden;
}

.ez2d-2fa-modal-shell.hidden {
    display: none !important;
}

.ez2d-2fa-modal-shell {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.ez2d-2fa-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--ez2d-2fa-backdrop);
    backdrop-filter: blur(6px);
}

.ez2d-2fa-modal {
    position: relative;
    z-index: 1;
    width: min(92vw, 640px);
    max-height: min(92vh, 860px);
    overflow-y: auto;
    margin: 4vh auto;
    padding: 26px 34px 30px;
    background: var(--ez2d-2fa-surface);
    border-radius: 22px;
    border-top: 6px solid var(--ez2d-2fa-accent);
    box-shadow: 0 28px 80px rgba(8, 28, 43, 0.32);
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.ez2d-2fa-modal-close,
.ez2d-2fa-modal-back {
    border: none;
    background: transparent;
    color: var(--ez2d-2fa-ink);
    cursor: pointer;
    font-weight: 700;
}

.ez2d-2fa-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8da1b0;
}

.ez2d-2fa-modal-close:hover,
.ez2d-2fa-modal-back:hover {
    background: rgba(13, 75, 110, 0.06);
}

.ez2d-2fa-modal-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 8px 10px;
    border-radius: 999px;
}

.ez2d-2fa-modal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

.ez2d-2fa-brand-logo,
.ez2d-2fa-brand-fallback {
    width: 96px;
    height: 96px;
    border-radius: 999px;
    object-fit: cover;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 48%, var(--ez2d-2fa-accent) 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.ez2d-2fa-brand-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ez2d-2fa-ink);
    font-size: 38px;
    font-weight: 800;
}

.ez2d-2fa-modal-title {
    margin: 0;
    color: #1d2a33;
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.ez2d-2fa-modal-subtitle {
    margin: -6px auto 0;
    max-width: 520px;
    color: #3e4f5c;
    font-size: 20px;
    line-height: 1.5;
}

.ez2d-2fa-choice-list {
    width: min(100%, 470px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.ez2d-2fa-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 2px solid var(--ez2d-2fa-border);
    border-radius: 16px;
    text-align: left;
    cursor: pointer;
    background: #fbfdff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.ez2d-2fa-choice.hidden {
    display: none !important;
}

.ez2d-2fa-choice:hover,
.ez2d-2fa-choice.is-selected {
    border-color: var(--ez2d-2fa-accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.ez2d-2fa-choice input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--ez2d-2fa-ink);
    flex: 0 0 auto;
}

.ez2d-2fa-choice-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ez2d-2fa-choice-label {
    color: var(--ez2d-2fa-ink);
    font-size: 20px;
    font-weight: 800;
}

.ez2d-2fa-choice-meta {
    color: var(--ez2d-2fa-ink-soft);
    font-size: 15px;
}

.ez2d-auth-message-slot--modal {
    min-height: 22px;
}

.ez2d-2fa-local-next {
    color: var(--ez2d-2fa-ink);
    font-weight: 700;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
}

.ez2d-2fa-local-next:hover {
    background: rgba(13, 75, 110, 0.08);
    color: var(--ez2d-2fa-ink);
}

.ez2d-2fa-modal .ez2d-btn-primary {
    width: min(100%, 420px);
    min-height: 58px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(180deg, #60a5fa 0%, var(--ez2d-2fa-accent) 55%, var(--ez2d-2fa-accent-deep) 100%);
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.ez2d-2fa-modal .ez2d-btn-primary:hover {
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 52%, #1d4ed8 100%);
}

.ez2d-2fa-box {
    width: min(100%, 430px);
}

.ez2d-2fa-inputs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 8px !important;
    max-width: 340px !important;
    margin: 0 auto !important;
}

.ez2d-2fa-inputs input {
    flex: 0 0 auto !important;
    width: 46px !important;
    height: 60px !important;
    font-size: 28px !important;
    font-weight: 700;
    border: 2px solid #cbd8e2 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

.ez2d-2fa-inputs input:focus {
    border-color: var(--ez2d-2fa-accent-deep) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18) !important;
}

.ez2d-2fa-submit {
    margin-top: 6px;
}

@media (max-width: 768px) {
    .ez2d-2fa-modal {
        width: min(calc(100vw - 24px), 100%);
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        margin: 12px auto;
        padding: 16px 14px 18px;
        border-radius: 18px;
    }

    .ez2d-2fa-brand-logo,
    .ez2d-2fa-brand-fallback {
        width: 82px;
        height: 82px;
    }

    .ez2d-2fa-modal-title {
        font-size: 24px;
    }

    .ez2d-2fa-modal-subtitle {
        font-size: 16px;
    }

    .ez2d-2fa-choice {
        padding: 14px;
    }

    .ez2d-2fa-choice-label {
        font-size: 17px;
    }

    .ez2d-2fa-modal .ez2d-btn-primary {
        width: 100%;
        font-size: 18px;
    }

    .ez2d-2fa-inputs {
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 6px !important;
        max-width: 100% !important;
        width: min(100%, 320px) !important;
        overflow: hidden !important;
    }

    .ez2d-2fa-inputs input {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 50px !important;
        font-size: 22px !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .ez2d-2fa-modal {
        width: min(calc(100vw - 18px), 100%);
        max-width: calc(100vw - 18px);
        padding: 14px 12px 16px;
    }

    .ez2d-2fa-inputs {
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 4px !important;
        width: min(100%, 288px) !important;
    }

    .ez2d-2fa-inputs input {
        width: 100% !important;
        max-width: none !important;
        height: 46px !important;
        font-size: 20px !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
    }

    .ez2d-2fa-modal .ez2d-btn-primary {
        min-height: 52px;
        font-size: 17px;
    }
}

