/* HikerScrolls — Shared Auth Modal Styles */

/* ── Overlay ── */
.hk-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  animation: hkAuthFadeIn 0.2s ease;
}

@keyframes hkAuthFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Modal Card ── */
.hk-auth-modal {
  background: #fff;
  border-radius: 16px;
  width: 400px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: hkAuthSlideUp 0.25s ease;
}

@keyframes hkAuthSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hk-auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.hk-auth-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.hk-auth-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.hk-auth-close:hover {
  color: #475569;
  background: #f1f5f9;
}

/* ── Tabs ── */
.hk-auth-tabs {
  display: flex;
  gap: 0;
  padding: 16px 24px 0;
  border-bottom: 1px solid #e2e8f0;
}

.hk-auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.hk-auth-tab:hover {
  color: #475569;
}

.hk-auth-tab.active {
  color: #2d6a4f;
  border-bottom-color: #2d6a4f;
}

/* ── Body ── */
.hk-auth-body {
  padding: 20px 24px 24px;
}

/* ── SSO Buttons ── */
.hk-auth-sso {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.hk-auth-sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.hk-auth-sso-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hk-auth-sso-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hk-auth-sso-btn svg {
  flex-shrink: 0;
}

/* ── Divider ── */
.hk-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hk-auth-divider::before,
.hk-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ── Form ── */
.hk-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hk-auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hk-auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.hk-auth-field input {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.hk-auth-field input:focus {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.hk-auth-field input::placeholder {
  color: #cbd5e1;
}

/* ── Submit Button ── */
.hk-auth-submit {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: #2d6a4f;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 4px;
}

.hk-auth-submit:hover {
  background: #245a42;
}

.hk-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Forgot Password Link ── */
.hk-auth-forgot {
  background: none;
  border: none;
  color: #2d6a4f;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: right;
  margin-top: -4px;
}

.hk-auth-forgot:hover {
  text-decoration: underline;
}

/* ── Error / Success Messages ── */
.hk-auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.hk-auth-error.visible {
  display: block;
}

.hk-auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.hk-auth-success.visible {
  display: block;
}

/* ── Back Link ── */
.hk-auth-back {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.hk-auth-back:hover {
  color: #2d6a4f;
}

/* ── Auth Button (nav) ── */
.hk-auth-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.hk-auth-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* ── User Menu (logged in) ── */
.hk-auth-user-menu {
  position: relative;
}

.hk-auth-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2d6a4f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: box-shadow 0.15s;
}

.hk-auth-avatar:hover {
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.hk-auth-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 10001;
  padding: 6px;
  display: none;
}

.hk-auth-dropdown.open {
  display: block;
}

.hk-auth-dropdown-email {
  padding: 8px 10px;
  font-size: 12px;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-auth-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.hk-auth-dropdown-item:hover {
  background: #f1f5f9;
}

.hk-auth-dropdown-item.danger {
  color: #dc2626;
}

.hk-auth-dropdown-item.danger:hover {
  background: #fef2f2;
}

/* ── Toast ── */
.hk-auth-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: hkAuthToastIn 0.3s ease;
}

.hk-auth-toast.success {
  background: #15803d;
}

@keyframes hkAuthToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Spinner ── */
.hk-auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hkAuthSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes hkAuthSpin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .hk-auth-modal {
    width: 100%;
    max-width: 100vw;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }

  .hk-auth-overlay {
    align-items: flex-end;
  }
}
