/**
* 2007-2022 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2022 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/

.ecgauthfo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem 1rem;
  width: 100%;
  height: 100%;
  min-height: 130px;
  text-decoration: none;
  color: #232323;
  background: #fff;
  border: none;
  cursor: pointer;
  position: relative;
  transition: box-shadow .15s, transform .12s;
  font-family: inherit;
  outline: none;
}

.ecgauthfo-tile:hover,
.ecgauthfo-tile:focus {
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
  transform: translateY(-2px);
  z-index: 1;
}

.ecgauthfo-tile:active {
  transform: translateY(0);
}

/* Icône */
.ecgauthfo-tile__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: #232323;
}

/* Pastille statut (coin haut droit de l'icône) */
.ecgauthfo-tile__dot {
  position: absolute;
  top: -3px;
  right: -6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.ecgauthfo-tile__dot--on   { background: #3aaa35; }
.ecgauthfo-tile__dot--warn { background: #f39c12; }

/* Label principal — majuscules comme les autres tuiles PS */
.ecgauthfo-tile__label {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.3;
  color: #232323;
}

/* Sous-label statut */
.ecgauthfo-tile__sub {
  display: block;
  font-style: normal;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  margin-top: 5px;
  text-transform: uppercase;
}
.ecgauthfo-tile__sub--on   { color: #3aaa35; }
.ecgauthfo-tile__sub--off  { color: #aaa; }
.ecgauthfo-tile__sub--warn { color: #d68910; }

/* Hint "cliquez pour…" affiché au hover */
.ecgauthfo-tile__hint {
  position: absolute;
  bottom: 7px;
  left: 0; right: 0;
  font-size: .65rem;
  color: #999;
  opacity: 0;
  transition: opacity .2s;
  text-transform: none;
  font-weight: 400;
  pointer-events: none;
}
.ecgauthfo-tile:hover .ecgauthfo-tile__hint,
.ecgauthfo-tile:focus .ecgauthfo-tile__hint {
  opacity: 1;
}

/* ─────────────────────────────────────────────
   MODALE (overlay)
   ───────────────────────────────────────────── */

.ecgauthfo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ecgauthfo-modal[hidden] { display: none; }

.ecgauthfo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.52);
  cursor: pointer;
}

.ecgauthfo-modal__box {
  position: relative;
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 34px 30px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  animation: ecgauthfo-pop .18s ease;
}
.ecgauthfo-modal__box--sm { max-width: 360px; }

@keyframes ecgauthfo-pop {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.ecgauthfo-modal__close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  font-size: 17px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.ecgauthfo-modal__close:hover { background: #f0f0f0; color: #333; }

.ecgauthfo-modal__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #1a1a2e;
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.ecgauthfo-modal__desc {
  color: #555;
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Étapes */
.ecgauthfo-steps {
  margin: 0 0 18px;
  padding: 0 0 0 18px;
}
.ecgauthfo-steps li {
  font-size: 13px;
  color: #444;
  margin-bottom: 5px;
  line-height: 1.5;
}

/* QR Code */
.ecgauthfo-modal__qr-wrap {
  text-align: center;
  margin: 0 0 16px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 14px;
}
.ecgauthfo-modal__qr {
  max-width: 190px;
  height: auto;
  display: inline-block;
  border-radius: 4px;
}

/* Saisie manuelle */
.ecgauthfo-manual {
  margin-bottom: 18px;
  font-size: 13px;
}
.ecgauthfo-manual summary {
  cursor: pointer;
  color: #3d6de1;
  font-weight: 600;
  padding: 4px 0;
  user-select: none;
  list-style: none;
}
.ecgauthfo-manual summary::-webkit-details-marker { display: none; }
.ecgauthfo-manual summary::before {
  content: '▸ ';
  font-size: 10px;
}
details[open] .ecgauthfo-manual summary::before { content: '▾ '; }

.ecgauthfo-manual__key {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  background: #f0f4ff;
  padding: 10px 14px;
  border-radius: 6px;
}
.ecgauthfo-manual__key code {
  font-size: 14px;
  letter-spacing: 2px;
  font-family: monospace;
  color: #1a1a2e;
  word-break: break-all;
  flex: 1;
}
.ecgauthfo-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background .12s;
}
.ecgauthfo-copy-btn:hover { background: #dce8ff; }

/* Formulaire code */
.ecgauthfo-modal__form { margin-top: 4px; }

.ecgauthfo-modal__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.ecgauthfo-code-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 28px;
  font-family: monospace;
  letter-spacing: 10px;
  text-align: center;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s;
  margin-bottom: 10px;
}
.ecgauthfo-code-input:focus  { border-color: #3d6de1; }
.ecgauthfo-code-input.is-error { border-color: #c0392b; }
.ecgauthfo-code-input.is-ok    { border-color: #27ae60; }

/* Feedback */
.ecgauthfo-modal__feedback {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.ecgauthfo-modal__feedback[hidden] { display: none; }
.ecgauthfo-modal__feedback--error  { background: #fdecea; color: #c0392b; }
.ecgauthfo-modal__feedback--ok     { background: #eafaf1; color: #1e8449; }

/* Actions */
.ecgauthfo-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Succès */
.ecgauthfo-modal__success {
  text-align: center;
  padding: 8px 0;
}
.ecgauthfo-modal__success-icon {
  font-size: 50px;
  display: block;
  margin-bottom: 12px;
}
.ecgauthfo-modal__success h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a2e;
}
.ecgauthfo-modal__success p {
  font-size: 13px;
  color: #555;
  margin-bottom: 18px;
}

/* ─────────────────────────────────────────────
   BOUTONS
   ───────────────────────────────────────────── */

.ecgauthfo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .14s, transform .1s;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: .03em;
}
.ecgauthfo-btn:hover  { opacity: .86; transform: translateY(-1px); }
.ecgauthfo-btn:active { transform: translateY(0); }
.ecgauthfo-btn[disabled] { opacity: .45; cursor: not-allowed; }

.ecgauthfo-btn--primary { background: #3d6de1; color: #fff; }
.ecgauthfo-btn--danger  { background: #c0392b; color: #fff; }
.ecgauthfo-btn--ghost   { background: transparent; color: #555; border: 1px solid #ccc; }

/* Spinner */
.ecgauthfo-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ecgauthfo-spin .6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes ecgauthfo-spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   PAGE DÉDIÉE 2FA (obligatoire au premier login)
   ───────────────────────────────────────────── */

.ecgauthfo-setup-page {
  max-width: 560px;
  margin: 0 auto;
}

.ecgauthfo-setup-page .ecgauthfo-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff8e1;
  border-left: 4px solid #f39c12;
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
  color: #5d4037;
}

.ecgauthfo-setup-page .ecgauthfo-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #f39c12;
}

.ecgauthfo-setup-steps {
  counter-reset: step;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.ecgauthfo-setup-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}
.ecgauthfo-setup-steps li::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: #3d6de1;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.ecgauthfo-setup-qr {
  text-align: center;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.ecgauthfo-setup-qr img {
  max-width: 200px;
  border-radius: 6px;
}

.ecgauthfo-setup-key {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  background: #eef2ff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
}
.ecgauthfo-setup-key code {
  font-size: 14px;
  letter-spacing: 2px;
  font-family: monospace;
  color: #1a1a2e;
}

.ecgauthfo-setup-validate {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 22px;
}
.ecgauthfo-setup-validate label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: #222;
}
.ecgauthfo-setup-validate small {
  display: block;
  color: #888;
  font-size: 12px;
  margin-top: 6px;
}

/* ─────────────────────────────────────────────
   PAGE VÉRIFICATION (code TOTP au login)
   ───────────────────────────────────────────── */

.ecgauthfo-verify-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 0;
}

.ecgauthfo-verify-card {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 38px 32px 28px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.ecgauthfo-verify-icon {
  margin-bottom: 16px;
}
.ecgauthfo-verify-icon svg {
  color: #3d6de1;
}

.ecgauthfo-verify-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a2e;
}

.ecgauthfo-verify-card p {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.ecgauthfo-verify-card .ecgauthfo-code-input {
  max-width: 240px;
  margin: 0 auto 12px;
  display: block;
}

.ecgauthfo-verify-help {
  margin-top: 22px;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}
.ecgauthfo-verify-help strong {
  display: block;
  margin-bottom: 4px;
  color: #333;
}
.ecgauthfo-verify-help ul {
  margin: 0;
  padding-left: 16px;
}

/* Responsive */
@media (max-width: 480px) {
  .ecgauthfo-modal__box    { padding: 22px 16px 18px; }
  .ecgauthfo-modal__title  { font-size: 15px; }
  .ecgauthfo-code-input    { font-size: 22px; letter-spacing: 6px; }
  .ecgauthfo-verify-card   { padding: 26px 18px 20px; }
}
