/* ============================================================
   TAOCA UI — Toasts + Modais (visual unificado com design system)
   ============================================================ */

/* =========================== TOASTS =========================== */
.taoca-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  width: 380px;
}
@media (max-width: 520px) {
  .taoca-toast-container {
    top: auto;
    bottom: 20px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.taoca-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: 12px;
  background: #FFF;
  border: 1px solid var(--border-soft, #ECE6D9);
  border-left: 4px solid var(--brand, #2F5D3A);
  border-radius: 12px;
  padding: 14px 14px 14px 16px;
  box-shadow: 0 10px 30px rgba(31, 58, 40, 0.12);
  font: inherit;
  color: var(--text-primary, #1F2937);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.22s ease;
}
.taoca-toast.is-show { transform: translateX(0); opacity: 1; }
.taoca-toast.is-hide { transform: translateX(120%); opacity: 0; }

.taoca-toast__icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}
.taoca-toast__body { min-width: 0; }
.taoca-toast__title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 2px;
  color: var(--text-primary, #1F2937);
  line-height: 1.3;
}
.taoca-toast__msg {
  font-size: 0.88rem;
  color: var(--text-secondary, #6B7280);
  line-height: 1.4;
  word-break: break-word;
}
.taoca-toast__close {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-muted, #9CA3AF);
  padding: 4px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.taoca-toast__close:hover { background: var(--taoca-coal-100, #F3F4F6); color: var(--text-primary, #1F2937); }

/* Variantes */
.taoca-toast--success { border-left-color: var(--success, #4A7856); }
.taoca-toast--success .taoca-toast__icon { background: var(--success-bg, #E5F0E7); color: var(--success, #4A7856); }
.taoca-toast--error   { border-left-color: var(--danger, #B91C1C); }
.taoca-toast--error   .taoca-toast__icon { background: var(--danger-bg, #FEE2E2); color: var(--danger, #B91C1C); }
.taoca-toast--warning { border-left-color: var(--warning, #C77B5C); }
.taoca-toast--warning .taoca-toast__icon { background: var(--warning-bg, #FBE8DD); color: var(--warning, #C77B5C); }
.taoca-toast--info    { border-left-color: var(--info, #1F5E7A); }
.taoca-toast--info    .taoca-toast__icon { background: var(--info-bg, #DCEBF1); color: var(--info, #1F5E7A); }

/* =========================== MODAIS =========================== */
.taoca-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.taoca-modal-overlay.is-show { opacity: 1; }
.taoca-modal-overlay.is-hide { opacity: 0; }

.taoca-modal {
  background: #FFF;
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(31, 58, 40, 0.30);
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.2s ease;
}
.taoca-modal-overlay.is-show .taoca-modal { transform: scale(1) translateY(0); opacity: 1; }

.taoca-modal__head {
  padding: 22px 24px 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.taoca-modal__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.taoca-modal--success .taoca-modal__icon { background: var(--success-bg, #E5F0E7); color: var(--success, #4A7856); }
.taoca-modal--info    .taoca-modal__icon { background: var(--info-bg, #DCEBF1);    color: var(--info, #1F5E7A); }
.taoca-modal--warning .taoca-modal__icon { background: var(--warning-bg, #FBE8DD); color: var(--warning, #C77B5C); }
.taoca-modal--danger  .taoca-modal__icon { background: var(--danger-bg, #FEE2E2);  color: var(--danger, #B91C1C); }

.taoca-modal__title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #1F2937);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.taoca-modal__body {
  padding: 12px 24px 8px;
  overflow-y: auto;
}
.taoca-modal__msg {
  font-size: 0.96rem;
  color: var(--text-secondary, #6B7280);
  line-height: 1.5;
  margin: 0;
}
.taoca-modal__input {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-default, #DDD4C2);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
  background: #FFF;
  color: var(--text-primary, #1F2937);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.taoca-modal__input:focus {
  border-color: var(--brand, #2F5D3A);
  box-shadow: 0 0 0 3px rgba(74, 120, 86, 0.18);
}

.taoca-modal__foot {
  padding: 14px 24px 22px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.taoca-btn {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  min-width: 100px;
  letter-spacing: 0.01em;
}
.taoca-btn:active { transform: translateY(1px); }
.taoca-btn:focus-visible { outline: 2px solid rgba(74, 120, 86, 0.45); outline-offset: 2px; }

.taoca-btn--primary {
  background: var(--brand, #2F5D3A);
  color: #FFF;
  border-color: var(--brand, #2F5D3A);
}
.taoca-btn--primary:hover { background: var(--taoca-green-700, #3D7048); border-color: var(--taoca-green-700, #3D7048); }

.taoca-btn--danger {
  background: var(--danger, #B91C1C);
  color: #FFF;
  border-color: var(--danger, #B91C1C);
}
.taoca-btn--danger:hover { background: #9B1818; border-color: #9B1818; }

.taoca-btn--ghost {
  background: transparent;
  color: var(--text-secondary, #6B7280);
  border-color: var(--border-default, #DDD4C2);
}
.taoca-btn--ghost:hover { background: var(--taoca-cream-100, #F4EFE6); color: var(--text-primary, #1F2937); }

/* Mobile */
@media (max-width: 480px) {
  .taoca-modal { max-width: 100%; }
  .taoca-modal__foot { flex-direction: column-reverse; }
  .taoca-btn { width: 100%; }
}

/* =========================== MODAL DE SENHA (TaocaAuth) =========================== */
.taoca-pwd-field {
  margin-bottom: 14px;
}
.taoca-pwd-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong, #1c1f2c);
  margin-bottom: 6px;
}
.taoca-pwd-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border, #d8dbe6);
  border-radius: 8px;
  background: var(--bg-input, #fff);
  color: var(--text, #1c1f2c);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.taoca-pwd-field input:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #2563eb) 18%, transparent);
}
.taoca-pwd-strength {
  margin-top: 8px;
  font-size: 12px;
  min-height: 16px;
}
.taoca-pwd-strength-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.taoca-pwd-strength-bar > div {
  height: 4px;
  background: var(--border, #e3e5ed);
  border-radius: 2px;
  transition: background 0.2s;
}
.taoca-pwd-strength-bar--weak   > div:nth-child(-n+1) { background: var(--danger, #dc2626); }
.taoca-pwd-strength-bar--medium > div:nth-child(-n+2) { background: var(--warning, #d97706); }
.taoca-pwd-strength-bar--good   > div:nth-child(-n+3) { background: var(--info, #2563eb); }
.taoca-pwd-strength-bar--strong > div { background: var(--success, #16a34a); }
.taoca-pwd-strength-label {
  color: var(--text-muted, #6b7280);
}
.taoca-pwd-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--danger, #dc2626) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger, #dc2626) 30%, transparent);
  color: var(--danger, #dc2626);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
