/* === VCP Auth Modal — Modern Redesign === */

.vcp-auth-open {
  padding: 10px 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}
.vcp-auth-open:hover {
  background: #333;
}

/* Overlay */
.vcp-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
  z-index: 99998;
}
.vcp-auth-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.vcp-auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, transform .25s ease;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 90%;
  max-width: 420px;
  padding: 2rem;
  font-family: "Inter", "Helvetica Neue", sans-serif;
}
.vcp-auth-modal.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Modal Panel */
.vcp-auth-panels {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  color: #222;
}

/* Close Button */
.vcp-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
  display: grid;
  place-items: center;
  line-height: 1;
}
.vcp-auth-close:hover {
  background: #333;
}

/* Tabs */
.vcp-auth-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.vcp-auth-tab {
  border: none;
  background: #eee;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background .2s;
}
.vcp-auth-tab.is-active {
  background: #111;
  color: #fff;
}

/* Forms */
.vcp-auth-panel {
  display: none;
}
.vcp-auth-panel.is-active {
  display: block;
}
.vcp-auth-panel h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}
.vcp-field {
  margin-bottom: 1rem;
}
.vcp-field label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.vcp-field input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}
.vcp-field input:focus {
  border-color: #111;
  outline: none;
}

.vcp-forgot,
.vcp-back {
  margin-top: 0.75rem;
  text-align: right;
  font-size: 0.9rem;
}

.vcp-forgot a,
.vcp-back a {
  color: #111;
  text-decoration: none;
}

.vcp-forgot a:hover,
.vcp-back a:hover {
  text-decoration: underline;
}

.vcp-login-error {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #c62828;
  display: none;
}

/* Actions */
.vcp-actions {
  margin-top: 1.25rem;
}
.vcp-actions button {
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: #111;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.vcp-actions button:hover {
  background: #333;
}

/* Google Login */
.vcp-social-login {
  text-align: center;
  margin-bottom: 1.5rem;
}
.vcp-google-login {
  border: 1px solid #ccc;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: background .2s;
}
.vcp-google-login:hover {
  background: #f2f2f2;
}

/* Captcha placeholder */
.vcp-captcha {
  margin: 1.25rem 0;
  min-height: 56px;
  border-radius: 6px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 0.85rem;
}

/* Errors */
.vcp-auth-error {
  margin-top: 1rem;
  color: #c62828;
  font-size: 0.9rem;
  display: none;
}

/* Logged-in greeting */
.vcp-auth-logged {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8f8f8;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "Inter", sans-serif;
}
.vcp-auth-greet {
  font-weight: 500;
}
.vcp-auth-logout {
  border: 0;
  background: #111;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s;
}
.vcp-auth-logout:hover {
  background: #333;
}

.vcp-auth-modal :focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* === Scoped Reset: Prevent Flex/Grid Inheritance === */
.vcp-auth-modal,
.vcp-auth-modal * {
  box-sizing: border-box;
  flex: none !important;
  align-self: auto !important;
  grid-area: auto !important;
}

/* Modal container (fixed overlay) */
.vcp-auth-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999 !important;
  background: #fff;
  width: 90%;
  max-width: 420px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 2rem;
  font-family: system-ui, sans-serif;
}

/* Overlay background */
.vcp-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99998;
}

/* Tabs */
.vcp-auth-tabs {
  display: flex !important;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.vcp-auth-tab {
  background: #eee;
  color: #000;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}
.vcp-auth-tab.is-active {
  background: #000;
  color: #fff;
}
