/* ==========================================================================
   Auth popover – light panel under account icon
   ========================================================================== */

.rn-auth-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 360px;
  max-width: min(360px, calc(100dvw - 24px));
  z-index: 10020;
  padding: 22px 20px 20px;
  color: #0a0a0a;
  background-color: #fff;
  border: 1px solid var(--rn-line, #e7e5e0);
  border-radius: var(--rn-radius-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.rn-auth-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rn-auth-popover__arrow {
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-top: 1px solid var(--rn-line, #e7e5e0);
  border-left: 1px solid var(--rn-line, #e7e5e0);
  transform: rotate(45deg);
  z-index: 1;
}

.rn-auth-popover__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--rn-radius-control);
  background: rgba(10, 10, 10, 0.06);
  color: #0a0a0a;
  cursor: pointer;
  transition: background 0.2s ease;
}

.rn-auth-popover__close:hover {
  background: rgba(10, 10, 10, 0.12);
}

.rn-auth-popover__close .material-symbols-rounded {
  font-size: 20px;
}

.rn-auth-popover__head {
  position: relative;
  z-index: 1;
  margin: 0 36px 14px 0;
}

.rn-auth-popover__eyebrow {
  margin: 0 0 6px;
  font-size: var(--rn-eyebrow-size);
  font-weight: 700;
  letter-spacing: var(--rn-eyebrow-track);
  text-transform: uppercase;
  color: var(--rn-accent-dark, #8a6a3b);
}

.rn-auth-popover__title {
  margin: 0 0 6px;
  font-family: var(--rn-font-display, inherit);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0a0a0a;
}

.rn-auth-popover__meta {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--rn-text-mute, #5c5c5c);
}

.rn-auth-modal__tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 1.15rem;
  border: 2px solid #0a0a0a;
  border-radius: var(--rn-radius-control);
  overflow: hidden;
}

.rn-auth-modal__tab {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.65rem 0.5rem;
  background: transparent;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.rn-auth-modal__tab + .rn-auth-modal__tab {
  border-left: 2px solid #0a0a0a;
}

.rn-auth-modal__tab.is-active {
  background: #0a0a0a;
  color: #fff;
}

.rn-auth-modal__tab:hover:not(.is-active) {
  color: #0a0a0a;
  background: rgba(10, 10, 10, 0.06);
}

.rn-auth-modal__panel[hidden] {
  display: none;
}

.rn-auth-modal__panels,
.rn-auth-modal__form {
  position: relative;
  z-index: 1;
}

.rn-auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.rn-auth-modal__field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rn-auth-modal__field label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rn-text-mute, #5c5c5c);
}

.rn-auth-modal__field input[type="text"],
.rn-auth-modal__field input[type="email"],
.rn-auth-modal__field input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(10, 10, 10, 0.25);
  border-radius: var(--rn-radius-control);
  background: #fff;
  color: #0a0a0a;
  font-size: 15px;
  font-family: inherit;
}

.rn-auth-modal__field input::placeholder {
  color: var(--rn-text-mute, #5c5c5c);
}

.rn-auth-modal__field input:focus {
  outline: none;
  border-color: #0a0a0a;
  background: #fff;
}

.rn-auth-modal__row {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rn-auth-modal__check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  color: #0a0a0a;
  cursor: pointer;
}

.rn-auth-modal__check input {
  margin: 0;
}

.rn-auth-modal__link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rn-accent-dark, #8a6a3b);
  text-decoration: none;
}

.rn-auth-modal__link:hover {
  color: #0a0a0a;
}

.rn-auth-modal__hint {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--rn-text-mute, #5c5c5c);
}

.rn-auth-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  margin-top: 0.15rem;
  border: 0;
  border-radius: var(--rn-radius-control);
  background: #0a0a0a;
  color: #fff;
  font-family: inherit;
  font-size: var(--rn-btn-size);
  font-weight: 700;
  letter-spacing: var(--rn-btn-track);
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  min-height: var(--rn-btn-height);
}

.rn-auth-modal__submit:hover {
  background: var(--rn-accent-dark, #8a6a3b);
  transform: translateY(-1px);
}

/* Dim page while auth is open */
body.rn-auth-open {
  overflow: hidden;
}

body.rn-auth-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10015;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

/* Mobile / tablet: bottom sheet, light solid panel */
@media (max-width: 768px) {
  .rn-auth-popover {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 100%);
    margin: 0;
    padding: 12px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--rn-radius-card) var(--rn-radius-card) 0 0;
    border: 1px solid var(--rn-line, #e7e5e0);
    border-bottom: 0;
    background-color: #fff;
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.18);
    opacity: 1;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(110%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 10025;
    padding-top: 22px;
  }

  .rn-auth-popover.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .rn-auth-popover__arrow {
    display: none;
  }

  .rn-auth-popover::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: var(--rn-radius-pill);
    background: rgba(10, 10, 10, 0.2);
    z-index: 3;
    pointer-events: none;
  }

  .rn-auth-popover__close {
    top: 14px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .rn-auth-popover__head {
    margin-right: 48px;
  }

  .rn-auth-modal__field input[type="text"],
  .rn-auth-modal__field input[type="email"],
  .rn-auth-modal__field input[type="password"] {
    font-size: 16px; /* prevent iOS zoom */
  }
}
