/**
 * SD Two-Factor Authentication – Styles
 *
 * @package SDAUTH
 */

/* ── Status badges ─────────────────────────────────────────────────────── */
.sdtfa-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    margin-right: 10px;
    vertical-align: middle;
}

.sdtfa-badge--active {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
    font-weight: 600;
}

.sdtfa-badge--inactive {
    background: #fef2f2;
    color: #b32d2e;
    border: 1px solid #dc3545;
    font-weight: 600;
}

.sdtfa-disable-btn {
    color: #b32d2e !important;
    border-color: #b32d2e !important;
}

.sdtfa-disable-btn:hover {
    background: #b32d2e !important;
    color: #fff !important;
}

/* ── Setup box ─────────────────────────────────────────────────────────── */
.sdtfa-setup-box {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 24px;
    max-width: 480px;
    margin-top: 16px;
}

.sdtfa-setup-box h3 {
    margin-top: 0;
    font-size: 18px;
}

.sdtfa-site-icon {
    text-align: center;
    margin-bottom: 12px;
}

.sdtfa-site-icon img {
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sdtfa-qr-wrapper {
    text-align: center;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 16px 0;
}

.sdtfa-qr-wrapper canvas {
    max-width: 250px;
    height: auto;
    image-rendering: pixelated;
}

/* ── Manual key ────────────────────────────────────────────────────────── */
.sdtfa-manual-key {
    margin: 12px 0;
}

.sdtfa-manual-key summary {
    cursor: pointer;
    color: #2271b1;
    font-size: 13px;
}

.sdtfa-secret-display {
    display: block;
    margin-top: 8px;
    padding: 10px 14px;
    background: #f0f0f1;
    border-radius: 4px;
    font-size: 15px;
    font-family: Consolas, Monaco, monospace;
    letter-spacing: 2px;
    word-break: break-all;
    user-select: all;
}

/* ── Verify form ───────────────────────────────────────────────────────── */
.sdtfa-verify-form {
    margin-top: 20px;
}

.sdtfa-verify-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.sdtfa-code-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sdtfa-code-input {
    width: 140px !important;
    font-size: 20px !important;
    text-align: center;
    letter-spacing: 6px;
    font-family: Consolas, Monaco, monospace;
    padding: 6px 12px !important;
}

.sdtfa-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.sdtfa-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sdtfa-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ── App recommendation buttons ────────────────────────────────────────── */
.sdtfa-app-recommendations {
    margin-top: 16px;
}

.sdtfa-app-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sdtfa-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    line-height: 1.4;
}

.sdtfa-app-btn:hover {
    transform: translateY(-1px);
}

.sdtfa-app-btn--android {
    background: #3ddc84 !important;
    border-color: #30b06a !important;
    color: #1a3a2a !important;
}

.sdtfa-app-btn--android:hover {
    background: #30b06a !important;
}

.sdtfa-app-btn--ios {
    background: #007aff !important;
    border-color: #005ecb !important;
    color: #fff !important;
}

.sdtfa-app-btn--ios:hover {
    background: #005ecb !important;
}

/* ── WC account page specifics ─────────────────────────────────────────── */
.sdtfa-wc-intro {
    font-family: inherit;
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 16px;
}

.sdtfa-wc-setup-btn {
    font-size: 1em !important;
    padding: 10px 28px !important;
    margin-bottom: 0 !important;
}

.sdtfa-wc-app-recommendations {
    margin-top: 0;
    padding-top: 0;
}

.sdtfa-wc-app-recommendations .sdtfa-store-badges {
    margin-top: 16px;
    padding-top: 0;
    border-top: none;
}

.sdtfa-wc-app-recommendations p {
    font-family: inherit;
    font-size: 1em;
}

.sdtfa-wc-app-recommendations .description {
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* ── Login page ────────────────────────────────────────────────────────── */
.sdtfa-login-form {
    text-align: center;
}

.sdtfa-login-icon {
    margin-bottom: 12px;
}

.sdtfa-login-icon img {
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sdtfa-login-info {
    margin-bottom: 16px !important;
    text-align: left;
}

.sdtfa-login-code-input {
    font-size: 22px !important;
    text-align: center;
    letter-spacing: 8px;
    font-family: Consolas, Monaco, monospace;
}

.sdtfa-back-link {
    margin-top: 16px;
    font-size: 13px;
}

/* ── Popup overlay ─────────────────────────────────────────────────────── */
.sdtfa-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sdtfaFadeIn 0.25s ease-out;
}

@keyframes sdtfaFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sdtfa-popup {
    background: #fff;
    border-radius: 12px;
    padding: 36px 40px;
    max-width: 560px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-family: inherit;
    font-size: 16px;
    animation: sdtfaSlideUp 0.3s ease-out;
}

@keyframes sdtfaSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.sdtfa-popup-icon {
    margin-bottom: 16px;
}

.sdtfa-popup-icon img {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sdtfa-popup h2 {
    margin: 0 0 14px;
    font-size: 1.6em;
    color: #1d2327;
}

.sdtfa-popup p {
    color: #50575e;
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 14px;
}

.sdtfa-popup-enforced {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 1em;
    color: #856404 !important;
    line-height: 1.6;
}

.sdtfa-popup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0 20px;
}

.sdtfa-popup-actions .button {
    font-size: 1em !important;
    padding: 10px 28px !important;
}

.sdtfa-popup-apps {
    padding-top: 18px;
    margin-top: 14px;
}

.sdtfa-popup-apps .description {
    margin-bottom: 8px !important;
}

/* ── Setup box inside popup (no double border) ─────────────────────────── */
.sdtfa-popup .sdtfa-setup-box {
    border: none;
    padding: 0;
    margin-top: 0;
    max-width: 100%;
}

.sdtfa-popup .sdtfa-store-badges-label {
    font-size: 1em;
}

.sdtfa-popup .sdtfa-store-badges-note {
    font-size: 0.9em;
}

.sdtfa-popup .sdtfa-store-badge-appname {
    font-size: 0.95em;
}

/* ── Success phase ─────────────────────────────────────────────────────── */
.sdtfa-popup-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #d4edda;
    color: #155724;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ── WooCommerce My Account ────────────────────────────────────────────── */
.sdtfa-wc-account {
    max-width: 560px;
}

.sdtfa-wc-account h3 {
    margin-top: 0;
}

.sdtfa-wc-status {
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.7;
}

.sdtfa-wc-status--active {
    background: #d4edda;
    border: 2px solid #28a745;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.sdtfa-wc-status--inactive {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.sdtfa-wc-icon {
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
}

.sdtfa-wc-status .sdtfa-badge {
    font-size: 1em;
}

.sdtfa-wc-status .sdtfa-method-label {
    font-size: 0.95em;
    display: block;
    margin: 4px 0 0;
}

.sdtfa-wc-status .sdtfa-backup-count {
    font-size: 0.9em;
    display: block;
    margin: 2px 0 0;
}

.sdtfa-wc-status .description {
    margin: 10px 0 0;
    font-size: 0.9em;
    color: inherit;
}

/* ── Method choice cards ───────────────────────────────────────────────── */
.sdtfa-method-cards {
    display: flex;
    gap: 14px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.sdtfa-method-card {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 20px;
    border: 2px solid #c3c4c7;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    text-align: center;
    font-family: inherit;
    font-size: 0.95em;
    color: #50575e;
    line-height: 1.6;
}

.sdtfa-method-card:hover {
    border-color: #2271b1;
    box-shadow: 0 3px 12px rgba(34, 113, 177, 0.18);
    transform: translateY(-2px);
}

.sdtfa-method-card:active {
    border-color: #135e96;
    background: #f0f7fc;
    transform: translateY(0);
}

.sdtfa-method-card-icon {
    font-size: 40px;
    line-height: 1;
}

.sdtfa-method-card strong {
    font-size: 1.15em;
    color: #1d2327;
}

.sdtfa-method-card-desc {
    font-size: 0.85em;
    color: #646970;
}

/* ── Method label (displayed next to active badge) ─────────────────────── */
.sdtfa-method-label {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
    color: #646970;
    vertical-align: middle;
}

/* ── Resend link ───────────────────────────────────────────────────────── */
.sdtfa-resend-row {
    margin-top: 10px;
}

.sdtfa-resend-login {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}

/* ── Shortcode [sdtfa_status] ─────────────────────────────────────────── */
.sdtfa-shortcode {
    padding: 18px 22px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.7;
    margin: 20px 0;
}

.sdtfa-shortcode--active {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sdtfa-shortcode--inactive {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.sdtfa-shortcode-icon {
    font-size: 1.3em;
    vertical-align: middle;
    margin-right: 6px;
}

.sdtfa-shortcode-method {
    color: #646970;
    font-size: 0.9em;
}

.sdtfa-shortcode-warning {
    margin-bottom: 14px;
    font-size: 1em;
}

.sdtfa-shortcode-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.2s;
}

.sdtfa-shortcode-btn:hover {
    background: #135e96;
}

/* ── Enforce notice ────────────────────────────────────────────────────── */
.sdtfa-enforce-notice {
    border-left-color: #dba617 !important;
}

/* ── Deadline hints ────────────────────────────────────────────────────── */
.sdtfa-popup-deadline {
    background: #e8f0fe !important;
    border-color: #2271b1 !important;
    color: #1d2327 !important;
    font-size: 1em !important;
    padding: 16px 20px !important;
}

.sdtfa-shortcode-deadline {
    margin: 10px 0 14px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #dc3545;
    border-radius: 6px;
    font-size: 0.85em;
    color: #b32d2e;
    font-weight: 700;
    line-height: 1.5;
}

/* ── Backup codes ──────────────────────────────────────────────────────── */
.sdtfa-backup-box {
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 10px;
    padding: 24px;
    max-width: 480px;
    margin-top: 16px;
}

.sdtfa-backup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sdtfa-backup-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1d2327;
}

.sdtfa-backup-icon {
    font-size: 28px;
}

.sdtfa-backup-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 18px;
    font-family: inherit;
    font-size: 1em;
    color: #1d2327;
    line-height: 1.7;
}

.sdtfa-backup-warning strong {
    color: #b32d2e;
    font-weight: 700;
}

.sdtfa-backup-warning p {
    margin: 8px 0 0;
}

.sdtfa-backup-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 16px;
    padding: 14px;
    background: #f6f7f7;
    border-radius: 6px;
}

.sdtfa-backup-code {
    display: block;
    font-family: Consolas, Monaco, monospace;
    font-size: 15px;
    letter-spacing: 1px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    text-align: center;
    user-select: all;
}

.sdtfa-backup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sdtfa-backup-actions .button {
    display: inline-flex;
    align-items: center;
}

.sdtfa-backup-note {
    font-size: 12px;
    color: #646970;
    font-style: italic;
    margin: 0 0 16px;
}

.sdtfa-backup-done-wrap {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #e2e4e7;
}

/* ── Backup count in profile / WC ──────────────────────────────────────── */
.sdtfa-backup-count {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
    color: #646970;
    vertical-align: middle;
}

/* ── Login page backup hint ────────────────────────────────────────────── */
.sdtfa-backup-hint {
    font-size: 12px;
    color: #646970;
    margin-top: 6px !important;
    font-style: italic;
}

/* ── Official store badges ─────────────────────────────────────────────── */
.sdtfa-store-badges {
    margin-top: 20px;
    padding-top: 0;
}

.sdtfa-store-badges--inline {
    margin-top: 16px;
    padding-top: 12px;
}

.sdtfa-store-badges-label {
    font-family: inherit;
    font-size: 1em;
    margin: 0 0 4px;
}

.sdtfa-store-badges-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.sdtfa-store-badge-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sdtfa-store-badge-appname {
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
    padding-left: 2px;
}

.sdtfa-store-badge {
    display: inline-block;
    transition: opacity 0.15s, transform 0.1s;
}

.sdtfa-store-badge:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.sdtfa-store-badge img {
    display: block;
    height: auto;
    max-height: 54px;
}

.sdtfa-store-badges-note {
    font-family: inherit;
    font-size: 0.85em;
    color: #646970;
    margin: 14px 0 0;
    font-style: italic;
}

/* ── Backup code usage notice (frontend) ───────────────────────────────── */
.sdtfa-backup-used-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    max-width: 420px;
    padding: 16px 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-left: 4px solid #b32d2e;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    font-family: inherit;
    font-size: 0.9em;
    line-height: 1.6;
    color: #1d2327;
    animation: sdtfaSlideIn 0.3s ease-out;
}

.sdtfa-backup-used-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #b32d2e;
}

@keyframes sdtfaSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ── Login inline error ────────────────────────────────────────────────── */
.sdtfa-login-error {
    background: #fef2f2;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 10px 0;
    color: #b32d2e;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

/* ── Inline error (method choice, setup) ───────────────────────────────── */
.sdtfa-inline-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 12px 0;
    color: #b32d2e;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

/* ── Recovery key box (shown with backup codes) ────────────────────────── */
.sdtfa-recovery-key-box {
    background: #fef8f0;
    border: 2px solid #e6a817;
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0;
}

.sdtfa-recovery-key-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1em;
}

.sdtfa-recovery-key-header span {
    font-size: 1.3em;
}

.sdtfa-recovery-key-box p {
    font-size: 0.9em;
    color: #50575e;
    margin: 0 0 12px;
    line-height: 1.6;
}

.sdtfa-recovery-key-display {
    display: block;
    font-family: Consolas, Monaco, monospace;
    font-size: 15px;
    letter-spacing: 1.5px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    text-align: center;
    user-select: all;
    word-break: break-all;
}

/* ── Recovery status in profile ────────────────────────────────────────── */
.sdtfa-recovery-status {
    display: block;
    margin: 4px 0 0;
    font-size: 13px;
    color: #646970;
}

/* ── Login recovery section ────────────────────────────────────────────── */
.sdtfa-recovery-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #dcdcde;
    text-align: center;
}

.sdtfa-recovery-toggle {
    cursor: pointer;
    font-size: 12px;
    color: #646970;
    user-select: none;
}

.sdtfa-recovery-toggle:hover {
    color: #2271b1;
}

.sdtfa-recovery-form {
    margin-top: 12px;
    text-align: left;
}

.sdtfa-recovery-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.sdtfa-recovery-form input[type="text"] {
    width: 100%;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.sdtfa-recovery-form .button {
    width: 100%;
}

/* ── Recovery file admin notice ────────────────────────────────────────── */
.sdtfa-recovery-notice {
    border-left-color: #b32d2e !important;
}

/* ── end of file ── */

/* ── Hard enforcement popup ────────────────────────────────────────────── */
.sdtfa-popup-enforced--hard {
    background: #fef2f2;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 12px 0;
    color: #b32d2e;
    font-size: 1em;
    line-height: 1.6;
    text-align: center;
}

[data-sdtfa-enforced="1"] .sdtfa-popup {
    border-top: 4px solid #dc3545;
}

/* ── Trusted device checkbox on login ──────────────────────────────────── */
.sdtfa-trust-device {
    margin: 12px 0 4px;
}

.sdtfa-trust-device label {
    font-size: 13px;
    color: #50575e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sdtfa-trust-device input[type="checkbox"] {
    margin: 0;
}
