/* =============================================
 * MORPHOSE LOGIN / REGISTER - PREMIUM DESIGN
 * Responsive complet - Design cohérent TCN
 * ============================================= */

/* ---------- Container ---------- */
body .morphose-auth {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  background: #fff !important;
  color: #000 !important;
}

/* ---------- Switcher Tabs (Pills) ---------- */
body .morphose-auth__switcher {
  display: flex;
  gap: 4px;
  background: var(--iw-white, #fff);
  border: 1px solid var(--iw-border, #e2e8f0);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 40px;
  position: relative;
}

body .morphose-auth__tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--iw-gray, #777);
  text-align: center;
  position: relative;
  outline: none;
  border-radius: 999px;
  z-index: 1;
  text-decoration: none;
}

body .morphose-auth__tab--active {
  color: var(--iw-white, #fff);
  background: var(--iw-orange, #f05a2b);
  text-decoration: none;
}

body .morphose-auth__tab::before,
body .morphose-auth__tab::after {
  display: none !important;
  content: none !important;
}

body .morphose-auth__tab:hover:not(.morphose-auth__tab--active) {
  color: var(--iw-orange, #f05a2b);
  background: rgba(240, 90, 43, 0.06);
  text-decoration: none;
}

/* ---------- Form ---------- */
body .morphose-auth__form {
  animation: morphose-fadeIn 0.3s ease;
}

@keyframes morphose-fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Fields ---------- */
body .morphose-auth__field {
  margin-bottom: 20px;
}

body .morphose-auth__field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--iw-black);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body .morphose-auth__field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--iw-border);
  border-radius: var(--iw-radius) !important;
  font-size: 14px;
  background: #fff !important;
  color: #000 !important;
  transition: border-color 0.2s;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}

body .morphose-auth__field input:focus {
  border-color: var(--iw-black);
  background: #fff !important;
}

body .morphose-auth__field input::placeholder {
  color: var(--iw-gray) !important;
}

/* ---------- Row (2 cols) ---------- */
body .morphose-auth__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- Options (remember + forgot) ---------- */
body .morphose-auth__options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 13px;
  gap: 12px;
}

body .morphose-auth__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--iw-muted);
  flex-shrink: 0;
}

body .morphose-auth__checkbox input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--iw-black);
  cursor: pointer;
}

body .morphose-auth__link {
  color: var(--iw-muted);
  text-decoration: none;
  transition: color 0.2s;
  border-bottom: 1px solid var(--iw-muted);
}

body .morphose-auth__link:hover {
  color: var(--iw-black);
  border-bottom-color: var(--iw-black);
}

/* ---------- Optional label ---------- */
body .morphose-opt {
  font-weight: 400;
  color: var(--iw-muted);
  font-size: 11px;
}

/* ---------- Message ---------- */
body .morphose-auth__message {
  padding: 14px 16px;
  border-radius: var(--iw-radius) !important;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
  animation: morphose-fadeIn 0.3s ease;
}

body .morphose-auth__message--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

body .morphose-auth__message--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

body .morphose-auth__message--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* ---------- Buttons ---------- */
body .morphose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--iw-radius) !important;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.4;
  box-sizing: border-box;
  font-family: inherit;
}

body .morphose-btn--primary {
  background: var(--iw-orange, #f05a2b);
  color: var(--iw-white);
}

body .morphose-btn--primary:hover {
  background: #d94e24;
  color: var(--iw-white);
}

body .morphose-btn--primary:active {
  transform: scale(0.98);
}

body .morphose-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body .morphose-btn--danger {
  background: var(--iw-danger);
  color: var(--iw-white);
}

body .morphose-btn--danger:hover {
  background: #dc2626;
  color: var(--iw-white);
}

body .morphose-btn--outline {
  background: transparent;
  border: 1px solid var(--iw-border);
  color: var(--iw-black);
}

body .morphose-btn--outline:hover {
  background: var(--iw-gray-100);
  border-color: var(--iw-black);
}

body .morphose-btn--full {
  width: 100%;
}

body .morphose-btn--sm {
  padding: 10px 16px;
  font-size: 12px;
}

/* ---------- Connected state ---------- */
body .morphose-auth--connected {
  text-align: center;
  padding: 60px 40px;
}

body .morphose-auth__icon {
  font-size: 56px;
  margin-bottom: 16px;
}

body .morphose-auth__welcome {
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 500;
  color: var(--iw-black);
}

body .morphose-auth__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Notice system ---------- */
body .morphose-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--iw-radius) !important;
  font-size: 13px;
  margin-bottom: 16px;
}

body .morphose-notice--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

body .morphose-notice--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

body .morphose-notice--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

body .morphose-notice__icon {
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* =============================================
 * RESPONSIVE DESIGN
 * ============================================= */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  body .morphose-auth {
    padding: 32px 24px;
    max-width: 100%;
  }

  body .morphose-auth__switcher {
    margin-bottom: 32px;
    padding: 3px;
  }

  body .morphose-auth__tab {
    padding: 11px 12px;
    font-size: 12px;
  }

  body .morphose-auth__field {
    margin-bottom: 18px;
  }

  body .morphose-auth__field label {
    margin-bottom: 7px;
  }

  body .morphose-auth__row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body .morphose-auth__options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  body .morphose-btn {
    padding: 12px 24px;
  }

  body .morphose-btn--full {
    width: 100%;
  }

  body .morphose-auth--connected {
    padding: 40px 24px;
  }

  body .morphose-auth__actions {
    flex-direction: column;
  }

  body .morphose-auth__actions .morphose-btn {
    width: 100%;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  body .morphose-auth {
    padding: 24px 16px;
    margin: 0;
  }

  body .morphose-auth__switcher {
    margin-bottom: 28px;
    padding: 3px;
  }

  body .morphose-auth__tab {
    padding: 10px 8px;
    font-size: 11px;
    letter-spacing: 0.5px;
  }

  body .morphose-auth__field {
    margin-bottom: 16px;
  }

  body .morphose-auth__field label {
    font-size: 11px;
    margin-bottom: 6px;
  }

  body .morphose-auth__field input {
    padding: 12px 14px;
    font-size: 13px;
  }

  body .morphose-auth__row {
    gap: 12px;
  }

  body .morphose-auth__options {
    font-size: 12px;
  }

  body .morphose-auth__checkbox {
    gap: 6px;
  }

  body .morphose-btn {
    padding: 12px 20px;
    font-size: 12px;
    letter-spacing: 0.6px;
  }

  body .morphose-auth--connected {
    padding: 32px 16px;
  }

  body .morphose-auth__icon {
    font-size: 48px;
    margin-bottom: 12px;
  }

  body .morphose-auth__welcome {
    font-size: 15px;
    margin-bottom: 20px;
  }

  body .morphose-notice {
    font-size: 12px;
    padding: 12px 14px;
    gap: 10px;
  }

  body .morphose-auth__message {
    font-size: 12px;
    padding: 12px 14px;
  }
}

/* ---------- Password Visibility Toggle ---------- */
body .morphose-auth__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

body .morphose-auth__toggle-pass {
  position: absolute;
  right: 6px;
  background: transparent !important;
  border: none !important;
  color: var(--iw-gray, #888) !important;
  cursor: pointer;
  font-size: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none !important;
  z-index: 2;
  transition:
    background 0.2s,
    color 0.2s;
  padding: 0;
}

body .morphose-auth__toggle-pass:hover {
  background: var(--iw-gray-100, #f0f0f0) !important;
  color: var(--iw-black, #000) !important;
}

/* ---------- Password Strength Bar ---------- */
body .morphose-progress-container {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

body .morphose-progress-bar {
  height: 100%;
  width: 0;
  transition:
    width 0.3s,
    background-color 0.3s;
  border-radius: 2px;
}

body .morphose-strength-text {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
  min-height: 1.2em;
}

/* ---------- Spinner (Loading Button) ---------- */
.morphose-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: morphose-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes morphose-spin {
  to {
    transform: rotate(360deg);
  }
}

body .morphose-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Connected State: Avatar & Hello ---------- */
body .morphose-login__avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

body .morphose-login__avatar i.fas.fa-user-circle {
  font-size: 54px;
  color: var(--iw-black, #2c3e50);
  margin-bottom: 6px;
}

body .morphose-login__hello {
  font-size: 17px;
  color: var(--iw-black, #2c3e50);
  font-weight: 600;
  margin-top: 0;
}
