/* =========================================================
   AUTH MODAL
   ========================================================= */

.mc-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-auth-modal[hidden] {
  display: none;
}

.mc-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(8px);
}

.mc-auth-panel {
  position: relative;
  width: min(94vw, 460px);
  padding: 2rem 2rem 2.25rem;
  max-height: min(90vh, 92dvh);
  overflow-y: auto;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(122, 77, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 60%), var(--surface-2);
  border: 1px solid rgba(122, 77, 255, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 1;
}

.mc-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.mc-auth-close:hover {
  background: rgba(255, 50, 50, 0.25);
  color: #fff;
}

.mc-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.mc-auth-brand-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.mc-auth-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--foreground);
}

.mc-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mc-auth-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.mc-auth-tab.active {
  background: linear-gradient(135deg, var(--plum-soft), #9b6fff);
  color: #fff;
  box-shadow: 0 2px 10px rgba(122, 77, 255, 0.4);
}

.mc-auth-message {
  min-height: 18px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  padding: 0;
  color: var(--muted);
  text-align: center;
  transition: color 0.2s;
}

.mc-auth-message:empty {
  display: none;
}

.mc-auth-message[data-type="error"] {
  color: #ff7b7b;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.2);
  padding: 9px 12px;
  border-radius: 8px;
}

.mc-auth-message[data-type="success"] {
  color: #6fe8a0;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  padding: 9px 12px;
  border-radius: 8px;
}

.mc-auth-state {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(122, 77, 255, 0.2);
  background: rgba(122, 77, 255, 0.06);
  text-align: center;
}

.mc-auth-state[hidden] {
  display: none;
}

.mc-auth-state-avatar {
  font-size: 2rem;
  line-height: 1;
}

.mc-auth-state-email {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.mc-auth-state-email strong {
  color: var(--foreground);
}

.mc-auth-staff {
  margin: 0;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid rgba(155, 231, 161, 0.3);
  background: rgba(155, 231, 161, 0.1);
  color: #9be7a1;
  font-size: 0.88rem;
  font-weight: 600;
}

.mc-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 0.5rem;
}

.mc-auth-actions .btn {
  width: 100%;
}

.mc-auth-form {
  display: grid;
  gap: 1rem;
}

.mc-auth-form[hidden] {
  display: none;
}

.mc-auth-field {
  display: grid;
  gap: 6px;
}

.mc-auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.mc-auth-opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted-2);
}

.mc-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mc-auth-input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  pointer-events: none;
  line-height: 1;
}

.mc-auth-input-wrap input {
  width: 100%;
  padding: 12px 42px 12px 38px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--foreground);
  font-size: 0.98rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}

.mc-auth-input-wrap input:focus {
  outline: none;
  border-color: var(--plum-soft);
  box-shadow: 0 0 0 3px rgba(122, 77, 255, 0.18);
}

.mc-auth-input-wrap input::placeholder {
  color: var(--muted-2);
}

.mc-auth-pw-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.mc-auth-pw-toggle:hover {
  opacity: 1;
}

.mc-auth-submit {
  width: 100%;
  padding: 13px;
  margin-top: 0.25rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--plum-soft), #9b6fff);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 18px rgba(122, 77, 255, 0.4);
  transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
}

.mc-auth-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(122, 77, 255, 0.5);
}

.mc-auth-submit:active {
  transform: translateY(0);
}

.mc-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.25rem 0 1rem;
  color: var(--muted-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.mc-auth-divider::before,
.mc-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

.mc-auth-oauth {
  display: grid;
  gap: 10px;
}

.mc-auth-provider {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.mc-auth-provider:hover {
  background: rgba(255, 255, 255, 0.09);
}

.mc-auth-sub {
  color: var(--muted);
  margin: 0 0 var(--sp-20);
  font-size: 0.9rem;
}

.mc-auth-open {
  overflow: hidden;
}

.mc-settings-grid {
  display: grid;
  gap: 12px;
  margin: 0 0 var(--sp-20);
}

.mc-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-s);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 16, 0.6);
}

.mc-settings-row span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.mc-settings-row strong {
  font-size: 0.95rem;
  color: var(--foreground);
  font-weight: 600;
  text-align: right;
}

.mc-settings-panel {
  width: min(94vw, 490px);
}

.mc-settings-section .mc-settings-grid {
  margin: 0;
}

.mc-settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 2.5rem;
  margin-bottom: 1.25rem;
}

.mc-settings-avatar-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(122, 77, 255, 0.14);
  border: 2px solid rgba(122, 77, 255, 0.32);
}

.mc-settings-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mc-settings-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  transition: opacity 0.15s;
}

.mc-settings-avatar-fallback svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.mc-settings-avatar-wrap.has-avatar .mc-settings-avatar-fallback {
  opacity: 0;
}

.mc-settings-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mc-settings-identity-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-settings-identity-email {
  font-size: 0.8rem;
}
