/* =============================================================================
📄 FILE: stores/static/shared/login/store-login.css
🎯 PURPOSE: Auth Page Styling — Compact Form, Inputs, Buttons, Tips
🛠 VERSION: MPA Auth v1.5 — Tokenized Colors + Dupes Removed + Consistent Sections
============================================================================= */

/* -----------------------------------------------------------------------------
🔧 Base Theme & Variables (override via Theme Studio if desired)
----------------------------------------------------------------------------- */
:root {
  /* Background gradient */
  --color-bg-gradient-start: #0f2027;
  --color-bg-gradient-mid: #203a43;
  --color-bg-gradient-end: #2c5364;

  /* Surfaces & text */
  --color-bg-box: #1e1e2f;
  --color-text-main: #ffffff;
  --color-ink-muted: #cccccc;
  /* Brand Teal (match Ionabrand header tone) */
  --color-brand-teal: #0aa6a6; /* adjust as needed to match header */

  /* Brand & accents */
  --color-accent: #00d4ff; /* primary CTA / highlight */
  --color-accent-hover: #00b0da;
  --color-accent-active: #009cc4;
  --color-link-secondary: #bb88ff; /* links like "Forgot password?" */

  /* Inputs */
  --color-input-bg: #333333;
  --color-input-placeholder: #aaaaaa;

  /* Alerts */
  --color-error-bg: #ffe5e5;
  --color-error-text: #a80000;
  --color-error-border: #ffcccc;

  --color-success-bg: #e6ffe6;
  --color-success-text: #006600;
  --color-success-border: #b3ffb3;

  /* Misc */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* -----------------------------------------------------------------------------
🌌 Page Layout
----------------------------------------------------------------------------- */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    to right,
    var(--color-bg-gradient-start),
    var(--color-bg-gradient-mid),
    var(--color-bg-gradient-end)
  );
  color: var(--color-text-main);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0 40px;
  min-height: 100vh;
  margin: 0;
  overflow: hidden; /* hide body scrollbar; delegate to wrapper */
  /* Hide page scrollbar UI but allow scrolling */
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none; /* Firefox */
}

/* WebKit browsers */
body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
}

/* Make the outer wrapper the scroll container and hide its scrollbar UI */
.store-auth-outer-wrapper {
  max-height: 100vh;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.store-auth-outer-wrapper::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
}

/* -----------------------------------------------------------------------------
📦 Auth Container Box
----------------------------------------------------------------------------- */
.store-auth-container {
  /* Use brand teal for the store auth container to match header */
  background-color: var(--brand);
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
}

/* Close (X) button in the top-right corner */
.store-auth-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  text-decoration: none;
  color: var(--on_header, #fff);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease,
    opacity 0.15s ease;
}
.store-auth-close:hover {
  background: rgba(0, 0, 0, 0.35);
  transform: scale(1.04);
}
.store-auth-close:active {
  transform: scale(0.98);
}

/* -----------------------------------------------------------------------------
🧠 Header Fonts & Branding
----------------------------------------------------------------------------- */
.ionabrand-white {
  font-size: 18px;
  color: var(--color-text-main);
  font-weight: bold;
}

.setup-blue {
  font-size: 18px;
  color: var(--color-accent);
  margin-left: 6px;
}

/* -----------------------------------------------------------------------------
🖼️ Header Layout with Logo
----------------------------------------------------------------------------- */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 4px;
}

.auth-logo {
  width: 48px;
  height: auto;
}

.auth-heading-text h1,
.auth-heading-text h2 {
  font-size: 16px;
  margin: 0;
}

.auth-heading-text h2 {
  color: var(--color-accent);
  margin-top: 2px;
}

/* -----------------------------------------------------------------------------
🔐 Input Fields & Groups
----------------------------------------------------------------------------- */
.input-group {
  position: relative;
  margin-bottom: 10px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--color-ink-muted);
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--color-input-bg);
  color: var(--color-text-main);
  font-size: 13px;
  box-sizing: border-box;
}

input::placeholder {
  color: var(--color-input-placeholder);
}

/* Inline password toggle (icon/button) */
.password-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--color-ink-muted);
  cursor: pointer;
  background: none;
  border: none;
}

/* -----------------------------------------------------------------------------
🧷 Button Styling
----------------------------------------------------------------------------- */
button.auth-button {
  width: 100%;
  padding: 7px;
  background-color: var(--color-accent);
  color: #000;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
  margin-top: 6px;
}

button.auth-button:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
}

button.auth-button:active {
  background-color: var(--color-accent-active);
  transform: translateY(1px);
}

/* Generic active feedback for any button */
button:active {
  transform: scale(0.98);
}

/* -----------------------------------------------------------------------------
📝 Notes, Requirements, Tips
----------------------------------------------------------------------------- */
.form-note,
.form-notes,
.requirements,
.save-tip,
.password-rules {
  font-size: 12px;
  margin-top: 6px;
  text-align: left;
}

.password-rules {
  text-align: center;
  color: var(--color-ink-muted);
}

.note-header {
  margin-bottom: 4px;
}

.requirements {
  padding-left: 16px;
  list-style-type: disc;
  color: var(--color-ink-muted);
}

.save-tip {
  color: var(--color-input-placeholder);
}

/* -----------------------------------------------------------------------------
🧯 Alerts
----------------------------------------------------------------------------- */
.auth-error,
.auth-success {
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  text-align: left;
}

.auth-error {
  background-color: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}

.auth-success {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

/* -----------------------------------------------------------------------------
🔗 Links
----------------------------------------------------------------------------- */
/* Secondary Auth Button (Link Style) */
.auth-button.secondary {
  display: block;
  width: 100%;
  padding: 7px;
  background-color: transparent;
  border: 2px solid var(--color-link-secondary);
  color: var(--color-link-secondary);
  border-radius: var(--radius-lg);
  font-weight: bold;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  margin-top: 10px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.auth-button.secondary:hover {
  background-color: var(--color-link-secondary);
  color: #000;
  transform: translateY(-1px);
}

.auth-button.secondary:active {
  transform: translateY(1px);
}

.forgot-link {
  display: block;
  margin-top: 10px;
  text-align: left;
  color: var(--color-accent);
}

.forgot-link a,
.forgot-link a:visited {
  color: var(--color-link-secondary);
  text-decoration: none;
  font-weight: 600;
}

.forgot-link:hover a {
  text-decoration: underline;
}

/* Footer text / store links */
.store-auth-footer a,
.store-auth-footer a:visited {
  color: var(--color-link-secondary);
  font-weight: 600;
  text-decoration: none;
}

.store-auth-footer a:hover {
  text-decoration: underline;
}

/* -----------------------------------------------------------------------------
🛠 Reset Password — Layout & Elements
----------------------------------------------------------------------------- */
.store-auth-container h2 {
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 14px;
  color: var(--color-accent);
}

.store-auth-container form {
  margin-top: 12px;
}

.store-auth-container .form-notes {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-ink-muted);
}

.store-auth-container .forgot-link {
  margin-top: 16px;
  font-size: 13px;
  text-align: center;
}

.store-auth-container .forgot-link a {
  color: var(--color-link-secondary);
  font-weight: 600;
  text-decoration: none;
}

.store-auth-container .forgot-link a:hover {
  text-decoration: underline;
}

/* Mask & reset dialog */
.reset-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-reset-password-box {
  padding: 2rem;
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 90%;
  min-height: 450px;
  box-shadow: var(--shadow-md);
  background: var(--color-brand-teal);
  color: var(--color-text-main);
}

/* Hide login container when reset is active */
.reset-mask ~ .store-auth-container {
  display: none !important;
}

/* Email input tweak in reset flow */
input[type="email"] {
  width: 97%;
  margin: 0 auto;
  display: block;
}

/* -----------------------------------------------------------------------------
👁️ Input with Eye (Show/Hide)
----------------------------------------------------------------------------- */
.input-with-eye {
  position: relative;
  width: 100%;
}

.input-with-eye input {
  padding-right: 2rem; /* space for eye */
  box-sizing: border-box;
}

.toggle-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%); /* center vertically */
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  color: var(--color-ink-muted);
}
