/**
 * auth.css — Login, Register, Forgot/Reset Password, and Account.
 *
 * The whole point of these pages is that nobody looking at them should be
 * able to tell they're built on WordPress — see class-auth-controller.php's
 * own doc comment for the wp-login.php interception that backs this up
 * structurally. Visually, that means matching the editor's own design
 * system (variables.css's tokens: Poppins, the purple accent, the same
 * radii/shadows/border colours) rather than introducing a second unrelated
 * "marketing site" look — a customer moving from the login page into the
 * Studio itself should feel like they never left one continuous product.
 *
 * This file assumes variables.css is already loaded (it declares every
 * --eps-* custom property used throughout) but NOT the rest of the editor
 * bundle — see Frontend_Controller::enqueue_assets()'s auth branch, which
 * deliberately loads only fonts.css + variables.css + this file for these
 * pages, not the full canvas/toolbar/sidebar/layers stack a login form has
 * no use for.
 */

.eps-auth-page {
  min-height: 100vh;
  display: flex;
  font-family: var(--eps-font);
  background: var(--eps-bg);
}

/* ------------------------------------------------------- branded side panel */

/* Desktop only — see the breakpoint at the bottom of this file. Purple
   gradient echoing the same tone used for the editor header's own logo mark
   (.eps-toolbar__logo), so the auth pages read as clearly the same product
   as the Studio itself, not a separate marketing site bolted on. */
.eps-auth-side {
  flex: 0 0 42%;
  max-width: 480px;
  min-width: 360px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--eps-space-6) var(--eps-space-6) var(--eps-space-5);
  background: linear-gradient(160deg, #7A5CFF 0%, #6D4AFF 45%, #5A38E8 100%);
  overflow: hidden;
}

/* A faint, large-scale botanical motif scattered across the panel — echoes
   the logo's own eight-leaf flower without competing with it. Built as a
   repeating SVG data-URI background rather than a shipped image file, so
   there's nothing extra to load and it scales losslessly at any viewport
   size. Kept to a single thin stroke at low opacity — texture, not decoration
   that competes for attention with the actual sign-in task. */
.eps-auth-side::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.10;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='white' stroke-width='1.4'%3E%3Cpath d='M110 40c14 0 24 14 24 30s-10 30-24 40c-14-10-24-24-24-40s10-30 24-30z'/%3E%3Cpath d='M110 180c14 0 24-14 24-30s-10-30-24-40c-14 10-24 24-24 40s10 30 24 30z'/%3E%3Cpath d='M40 110c0-14 14-24 30-24s30 10 40 24c-10 14-24 24-40 24s-30-10-30-24z'/%3E%3Cpath d='M180 110c0-14-14-24-30-24s-30 10-40 24c10 14 24 24 40 24s30-10 30-24z'/%3E%3Cpath d='M65 65c10-10 26-10 36 0s10 26 0 36M155 65c-10-10-26-10-36 0s-10 26 0 36M65 155c10 10 26 10 36 0s10-26 0-36M155 155c-10 10-26 10-36 0s-10-26 0-36'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
  background-position: -30px -30px;
  pointer-events: none;
}

.eps-auth-side__top { position: relative; z-index: 1; }
.eps-auth-side__logo { width: 72px; height: 72px; border-radius: 18px; display: block; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); }
.eps-auth-side__wordmark {
  margin: var(--eps-space-4) 0 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}
.eps-auth-side__tagline {
  margin: var(--eps-space-2) 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  max-width: 34ch;
}

.eps-auth-side__features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--eps-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.eps-auth-side__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.eps-auth-side__features .eps-icon {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ------------------------------------------------------------- form column */

.eps-auth-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--eps-space-5);
  min-height: 100vh;
  overflow-y: auto;
}

.eps-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--eps-surface);
  border: 1px solid var(--eps-border);
  border-radius: var(--eps-radius-xl);
  box-shadow: var(--eps-shadow-lg);
  padding: var(--eps-space-6) var(--eps-space-5);
}

/* Only visible once .eps-auth-side is hidden below the breakpoint — see the
   media query at the end of this file. Keeps the brand present even on a
   narrow viewport where there's no room for the full split layout. */
.eps-auth-card__brand-compact {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--eps-space-5);
}
.eps-auth-card__brand-compact img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.eps-auth-card__brand-compact span { font-size: 15px; font-weight: 600; color: var(--eps-text-primary); letter-spacing: -0.01em; }

.eps-auth-card__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--eps-text-primary);
  margin: 0 0 6px;
}
.eps-auth-card__subtitle {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--eps-text-secondary);
  margin: 0 0 var(--eps-space-5);
}

/* A dismissable, page-level notice — used for the "check your email" success
   state on Forgot Password and for the account page's save confirmations.
   Deliberately the same visual language as the editor's .eps-note component
   (sidebar.css) so a returning customer who's seen that pattern in the
   Studio recognises it immediately here too. */
.eps-auth-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--eps-radius-md);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: var(--eps-space-4);
}
.eps-auth-notice--success { background: var(--eps-success-soft); color: #1B7A4D; }
.eps-auth-notice--error { background: var(--eps-warning-soft); color: #B32227; }
.eps-auth-notice .eps-icon { flex: none; margin-top: 1px; }

/* ------------------------------------------------------------- form fields */

.eps-auth-form { display: flex; flex-direction: column; gap: var(--eps-space-4); }
.eps-auth-field { display: flex; flex-direction: column; gap: 6px; }
.eps-auth-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--eps-text-primary);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.eps-auth-field__label a {
  font-size: 12px;
  font-weight: 500;
  color: var(--eps-accent);
  text-decoration: none;
}
.eps-auth-field__label a:hover { text-decoration: underline; }

/* Same border/radius/focus-ring language as the editor's own .eps-input
   (sidebar.css) — deliberately not identical class names, since these need
   to be taller (44px, comfortable for a primary sign-in action) than the
   editor's compact 30px toolbar inputs, but every colour/radius value below
   is the SAME custom property the editor itself uses. */
.eps-auth-input-wrap { position: relative; display: flex; align-items: center; }
.eps-auth-input {
  width: 100%;
  font-family: var(--eps-font);
  font-size: 14px;
  padding: 12px 14px;
  border-radius: var(--eps-radius-md);
  border: 1px solid var(--eps-border);
  background: var(--eps-surface);
  color: var(--eps-text-primary);
  transition: border-color var(--eps-duration-fast) var(--eps-ease-out),
              box-shadow var(--eps-duration-fast) var(--eps-ease-out);
}
.eps-auth-input::placeholder { color: var(--eps-text-tertiary); }
.eps-auth-input:hover:not(:focus) { border-color: var(--eps-border-strong); }
.eps-auth-input:focus {
  outline: none;
  border-color: var(--eps-accent);
  box-shadow: 0 0 0 3px var(--eps-accent-ring);
}
.eps-auth-input[type="password"] { padding-right: 44px; letter-spacing: 0.02em; }

.eps-auth-field.has-error .eps-auth-input { border-color: var(--eps-warning); }
.eps-auth-field.has-error .eps-auth-input:focus { box-shadow: 0 0 0 3px var(--eps-warning-soft); }
.eps-auth-field__error {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--eps-warning);
}

/* The eye / eye-off password-visibility toggle — see auth.js. A plain inline
   button positioned inside the input's own box, matching how the editor
   positions a unit suffix inside .eps-input-affix (sidebar.css). */
.eps-auth-toggle-visibility {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: var(--eps-radius-sm);
  color: var(--eps-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--eps-duration-fast) var(--eps-ease-out), color var(--eps-duration-fast) var(--eps-ease-out);
}
.eps-auth-toggle-visibility:hover { background: var(--eps-surface-sunken); color: var(--eps-text-secondary); }

/* A live strength hint under the password field on Register/Reset — text
   only, no coloured meter bar. A bar implies a precise, load-bearing
   measurement; the underlying check is just a length floor (see
   Auth_Validator's own doc comment on why composition rules were left out),
   so the UI is honest about that rather than dressing up a simple check as
   something more sophisticated than it is. */
.eps-auth-strength { font-size: 12px; color: var(--eps-text-tertiary); min-height: 15px; }
.eps-auth-strength.is-ok { color: var(--eps-success); }

.eps-auth-row { display: flex; align-items: center; justify-content: space-between; gap: var(--eps-space-3); }
.eps-auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--eps-text-secondary);
  cursor: pointer;
  user-select: none;
}
.eps-auth-checkbox input { accent-color: var(--eps-accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.eps-auth-row a { font-size: 13px; font-weight: 500; color: var(--eps-accent); text-decoration: none; }
.eps-auth-row a:hover { text-decoration: underline; }

/* Primary submit — the exact same purple as .eps-btn--primary elsewhere in
   the app, sized for a full-width primary form action rather than a compact
   toolbar button. */
.eps-auth-submit {
  width: 100%;
  font-family: var(--eps-font);
  font-size: 14.5px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: var(--eps-radius-md);
  border: 1px solid var(--eps-accent);
  background: var(--eps-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(109, 74, 255, 0.28);
  transition: background var(--eps-duration-fast) var(--eps-ease-out),
              border-color var(--eps-duration-fast) var(--eps-ease-out),
              transform var(--eps-duration-fast) var(--eps-ease-out);
}
.eps-auth-submit:hover { background: var(--eps-accent-strong); border-color: var(--eps-accent-strong); }
.eps-auth-submit:active { transform: translateY(1px); }
.eps-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* A small inline spinner shown on the submit button while auth.js's fetch-
   free native form submit is in flight (the browser's own navigation is
   already happening — this is purely so the button doesn't look inert
   during that brief gap on a slow connection). Pure CSS, no JS animation
   loop. */
.eps-auth-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: eps-auth-spin 0.7s linear infinite;
}
.eps-auth-submit.is-loading .eps-auth-spinner { display: inline-block; }
.eps-auth-submit.is-loading .eps-auth-submit__label { opacity: 0.85; }
@keyframes eps-auth-spin { to { transform: rotate(360deg); } }

.eps-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--eps-space-5) 0;
  color: var(--eps-text-tertiary);
  font-size: 12px;
}
.eps-auth-divider::before, .eps-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--eps-border-subtle); }

.eps-auth-footer {
  margin-top: var(--eps-space-5);
  text-align: center;
  font-size: 13px;
  color: var(--eps-text-secondary);
}
.eps-auth-footer a { color: var(--eps-accent); font-weight: 600; text-decoration: none; }
.eps-auth-footer a:hover { text-decoration: underline; }

.eps-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--eps-text-secondary);
  text-decoration: none;
  margin-bottom: var(--eps-space-4);
}
.eps-auth-back:hover { color: var(--eps-text-primary); }

/* ---------------------------------------------------------- account page */

/* The account page is reached only once already signed in, so it uses the
   SAME app-bar chrome as the front-end dashboard (frontend.css's
   .eps-frontend-appbar) rather than the marketing-style split card above —
   it's a page inside the product, not an entry point into it. */
.eps-account-page { max-width: 720px; margin: 0 auto; padding: var(--eps-space-5) var(--eps-space-4) var(--eps-space-6); }
.eps-account-header { display: flex; align-items: center; gap: var(--eps-space-3); margin-bottom: var(--eps-space-5); }
.eps-account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--eps-accent-soft);
  color: var(--eps-accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex: none;
}
.eps-account-header h1 { font-size: 19px; font-weight: 600; margin: 0 0 2px; color: var(--eps-text-primary); }
.eps-account-header p { margin: 0; font-size: 13px; color: var(--eps-text-secondary); }

.eps-account-section {
  background: var(--eps-surface);
  border: 1px solid var(--eps-border);
  border-radius: var(--eps-radius-lg);
  padding: var(--eps-space-5);
  margin-bottom: var(--eps-space-4);
}
.eps-account-section h2 { font-size: 14px; font-weight: 600; margin: 0 0 4px; color: var(--eps-text-primary); }
.eps-account-section > p.eps-account-section__desc { margin: 0 0 var(--eps-space-4); font-size: 12.5px; color: var(--eps-text-secondary); }
.eps-account-section .eps-auth-form { gap: var(--eps-space-3); }
.eps-account-section .eps-auth-submit { width: auto; padding: 10px 22px; margin-top: var(--eps-space-1); }
.eps-account-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--eps-space-3); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 880px) {
  .eps-auth-side { display: none; }
  .eps-auth-card__brand-compact { display: flex; }
  .eps-auth-main { padding: var(--eps-space-4); }
}

@media (max-width: 480px) {
  .eps-auth-card { padding: var(--eps-space-5) var(--eps-space-4); border-radius: var(--eps-radius-lg); }
  .eps-account-row { grid-template-columns: 1fr; }
}
