/* Shared luxury auth surfaces (storefront + admin login) */
.yni-auth-page {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans, "DM Sans", system-ui, sans-serif);
  color: var(--st-text, #2c1810);
  background: var(--st-bg, #f7f3ed);
  background-image: radial-gradient(
      ellipse 120% 80% at 100% 0%,
      rgba(212, 181, 140, 0.18),
      transparent 52%
    ),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(139, 105, 20, 0.07), transparent 46%);
}

.yni-auth-page.is-rtl {
  font-family: "Noto Sans Arabic", var(--font-sans, "DM Sans"), system-ui, sans-serif;
}

.yni-auth-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.yni-auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.yni-auth-brand .site-logo {
  height: 64px;
  width: auto;
  max-width: min(320px, 92vw);
  object-fit: contain;
  margin: 0 auto 0.75rem;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(44, 24, 16, 0.1);
}

@media (max-width: 480px) {
  .yni-auth-brand .site-logo {
    height: 52px;
  }
}

.yni-auth-brand h1 {
  margin: 0;
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--st-chocolate, #4a2f1f);
}

.yni-auth-brand p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--st-muted, #6b5346);
}

.yni-auth-card {
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 22px;
  background: rgba(253, 251, 247, 0.72);
  border: 1px solid rgba(61, 41, 20, 0.12);
  box-shadow: 0 20px 50px rgba(44, 24, 16, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: yni-auth-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes yni-auth-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.yni-auth-field {
  margin-bottom: 1rem;
}

.yni-auth-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-muted, #6b5346);
  margin-bottom: 0.35rem;
}

.yni-auth-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(61, 41, 20, 0.14);
  font: inherit;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.yni-auth-field input:focus {
  outline: none;
  border-color: rgba(139, 105, 20, 0.45);
  box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.12);
}

.yni-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.yni-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
}

.yni-auth-btn:active {
  transform: scale(0.98);
}

.yni-auth-btn--primary {
  background: linear-gradient(180deg, #a67c2e, #8b6914);
  color: #fff;
  box-shadow: 0 1px 2px rgba(44, 24, 16, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.yni-auth-btn--primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 10px 28px rgba(139, 105, 20, 0.22);
}

.yni-auth-btn--ghost {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(61, 41, 20, 0.14);
  color: var(--st-chocolate, #4a2f1f);
}

.yni-auth-btn--ghost:hover {
  background: #fff;
}

.yni-auth-msg {
  min-height: 1.35rem;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #8a3b38;
}

.yni-auth-msg--ok {
  color: #3d6b4a;
}

.yni-auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.88rem;
}

.yni-auth-links a {
  color: #8b6914;
  font-weight: 600;
  text-decoration: none;
}

.yni-auth-links a:hover {
  text-decoration: underline;
}

.yni-auth-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.yni-auth-btn--compact {
  width: auto;
  padding: 0.45rem 0.85rem;
}

.yni-auth-lang {
  padding: 0.4rem 0.65rem;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(61, 41, 20, 0.14);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--st-chocolate, #4a2f1f);
}

.yni-auth-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--st-muted, #9a8478);
}

html[dir="rtl"] .yni-auth-field input {
  text-align: right;
}

html[dir="rtl"] .yni-auth-field label {
  text-align: right;
}

html[dir="rtl"] .yni-auth-links,
html[dir="rtl"] .yni-auth-footer {
  text-align: center;
}

html[dir="rtl"] .yni-account-panel {
  text-align: right;
}

html[dir="rtl"] .yni-account-panel h2 {
  text-align: right;
}

html[dir="rtl"] .yni-order-row {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .yni-address-card {
  text-align: right;
}

html[dir="rtl"] .yni-auth-top > div .yni-auth-btn {
  text-align: center;
}

html[dir="rtl"] .yni-auth-card h1,
html[dir="rtl"] .yni-auth-card h2 {
  text-align: right;
}

html[dir="rtl"] .yni-auth-top > a:first-child {
  margin-left: auto;
  margin-right: 0;
}

html[dir="rtl"] .yni-auth-lang {
  margin-right: auto;
  margin-left: 0;
}

html[dir="rtl"] .admin-login-page .yni-auth-footer {
  text-align: center;
}

/* Account dashboard */
.yni-account-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .yni-account-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.yni-account-panel {
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  background: rgba(253, 251, 247, 0.75);
  border: 1px solid rgba(61, 41, 20, 0.12);
  box-shadow: 0 12px 36px rgba(44, 24, 16, 0.08);
  backdrop-filter: blur(10px);
}

.yni-account-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 1.35rem;
  color: var(--st-chocolate, #4a2f1f);
}

.yni-order-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(61, 41, 20, 0.08);
  font-size: 0.9rem;
}

.yni-order-row:last-child {
  border-bottom: none;
}

.yni-address-card {
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(61, 41, 20, 0.1);
  font-size: 0.88rem;
}

.yni-address-card button {
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

@media (max-width: 380px) {
  .yni-auth-top {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }
  .yni-auth-top .yni-auth-btn {
    text-align: center !important;
    width: 100% !important;
  }
  .yni-auth-top > div {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  .yni-auth-top > div .yni-auth-btn {
    flex: 1 !important;
  }

  .yni-auth-card {
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .yni-auth-brand h1 {
    font-size: 1.5rem;
  }

  .yni-auth-shell {
    padding: 1.5rem 0.85rem 2rem;
  }

  .yni-auth-field input {
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .yni-auth-shell {
    padding: 1rem 0.65rem 1.5rem;
  }

  .yni-auth-card {
    padding: 1rem 0.85rem;
    border-radius: 16px;
  }

  .yni-auth-brand .site-logo {
    height: 44px;
  }

  .yni-auth-brand h1 {
    font-size: 1.35rem;
  }

  .yni-auth-actions .yni-auth-btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
  }
}

/* ── Premium two-column layout (desktop) ── */
.yni-auth-layout {
  display: flex;
  min-height: 100vh;
}

.yni-auth-hero {
  display: none;
  flex: 1 1 50%;
  position: relative;
  background: linear-gradient(165deg, #f7f0e6, #ede3d4, #e4d5bf);
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.yni-auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, rgba(212, 181, 140, 0.35), transparent 65%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(139, 105, 20, 0.12), transparent 55%);
}

.yni-auth-hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 4rem;
  max-width: 480px;
}

.yni-auth-hero__inner .site-logo {
  height: 96px;
  width: auto;
  max-width: min(280px, 80vw);
  object-fit: contain;
  margin: 0 auto 1.5rem;
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(44, 24, 16, 0.12);
}

.yni-auth-hero__inner h1 {
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 2.85rem;
  font-weight: 600;
  color: var(--st-chocolate, #4a2f1f);
  margin: 0 0 0.65rem;
  line-height: 1.2;
}

.yni-auth-hero__inner p {
  font-size: 1.05rem;
  color: var(--st-muted, #6b5346);
  line-height: 1.6;
  margin: 0;
}

.yni-auth-hero__ornament {
  display: inline-block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a67c2e, transparent);
  margin: 1rem auto 1.25rem;
  border-radius: 1px;
}

.yni-auth-hero__decor {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

.yni-auth-hero__decor--1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #8b6914, transparent 70%);
  top: -80px;
  right: -60px;
}

.yni-auth-hero__decor--2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, #a67c2e, transparent 70%);
  bottom: -40px;
  left: -40px;
}

@media (min-width: 820px) {
  .yni-auth-hero {
    display: flex;
  }

  .yni-auth-form-col {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .yni-auth-form-col .yni-auth-shell {
    max-width: 440px;
    width: 100%;
    padding: 2.5rem 2rem;
    margin: 0;
  }

  .yni-auth-form-col .yni-auth-card {
    margin: 0;
  }

  .yni-auth-form-col .yni-auth-brand {
    display: none;
  }
}

/* ── Input wrapper (password toggle positioning) ── */
.yni-input-wrap {
  position: relative;
}

.yni-input-wrap input {
  padding-right: 2.6rem !important;
}

html[dir="rtl"] .yni-input-wrap input {
  padding-right: 0.85rem !important;
  padding-left: 2.6rem !important;
}

/* ── Password visibility toggle ── */
.yni-pass-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.5rem;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: #8a7a6a;
  line-height: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.yni-pass-toggle:hover {
  color: var(--st-chocolate, #4a2f1f);
  background: rgba(44, 24, 16, 0.06);
}

.yni-pass-toggle:focus-visible {
  outline: 2px solid rgba(139, 105, 20, 0.5);
  outline-offset: 2px;
}

html[dir="rtl"] .yni-pass-toggle {
  right: auto;
  left: 0.45rem;
}

/* ── Password strength meter ── */
.yni-strength-wrap {
  margin-top: 0.4rem;
}

.yni-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: #e8e0d8;
  overflow: hidden;
  transition: background 0.3s ease;
}

.yni-strength-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.35s ease, background 0.35s ease;
}

.yni-strength-label {
  font-size: 0.72rem;
  color: var(--st-muted, #8a7a6a);
  margin-top: 0.25rem;
  min-height: 1rem;
  transition: color 0.25s ease;
}

/* ── Field validation states ── */
.yni-field--error input {
  border-color: #b44a3a !important;
  box-shadow: 0 0 0 3px rgba(180, 74, 58, 0.1) !important;
}

.yni-field--error .yni-field-hint {
  color: #b44a3a;
}

.yni-field--valid input {
  border-color: #4a8a5c !important;
  box-shadow: 0 0 0 3px rgba(74, 138, 92, 0.1) !important;
}

.yni-field-hint {
  font-size: 0.72rem;
  color: var(--st-muted, #8a7a6a);
  margin-top: 0.2rem;
  min-height: 1rem;
  transition: color 0.2s ease;
}

/* ── Enhanced input focus (additive) ── */
.yni-auth-field input:focus {
  border-color: rgba(139, 105, 20, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.12), 0 2px 8px rgba(44, 24, 16, 0.06);
}

/* ── Loading spinner ── */
.yni-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yni-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes yni-spin {
  to { transform: rotate(360deg); }
}

.yni-auth-btn--ghost .yni-spinner {
  border-color: rgba(44, 24, 16, 0.18);
  border-top-color: var(--st-chocolate, #4a2f1f);
}

/* ── Disabled state ── */
.yni-auth-btn:disabled,
.yni-auth-btn.is-loading {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

.yni-auth-btn.is-loading .yni-btn-text {
  opacity: 0.85;
}

.yni-auth-field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Enhanced error message ── */
.yni-auth-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.yni-auth-msg::before {
  content: "";
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-top: 0.1em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E") center/contain no-repeat;
  display: none;
}

.yni-auth-msg--ok::before {
  display: block;
  color: #3d6b4a;
}

.yni-auth-msg--error::before {
  display: none;
}

/* ── Live field counter / hint spacing ── */
.yni-auth-field + .yni-auth-field {
  margin-top: 0;
}

/* ── Better spacing for register fields ── */
.yni-field-group {
  margin-bottom: 1rem;
}

.yni-field-group .yni-auth-field {
  margin-bottom: 0.65rem;
}

.yni-field-group:last-child {
  margin-bottom: 0;
}

/* ── Smooth entrance for form card ── */
.yni-auth-card {
  animation: yni-auth-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Success flash on the card after register ── */
.yni-auth-card--success {
  animation: yni-auth-success 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes yni-auth-success {
  0% { transform: scale(1); }
  30% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ── Password visibility icon ── */
.yni-pass-toggle svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

/* ── Dark Mode ── */
[data-theme="dark"] .yni-auth-page {
  background: var(--color-bg);
  color: var(--color-text);
}

[data-theme="dark"] .yni-auth-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .yni-auth-card h1,
[data-theme="dark"] .yni-auth-card h2,
[data-theme="dark"] .yni-auth-card p {
  color: var(--color-text);
}

[data-theme="dark"] .yni-auth-card label {
  color: var(--color-text-muted);
}

[data-theme="dark"] .yni-auth-field input,
[data-theme="dark"] .yni-auth-field textarea {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .yni-auth-field input::placeholder,
[data-theme="dark"] .yni-auth-field textarea::placeholder {
  color: var(--color-text-light);
}

[data-theme="dark"] .yni-auth-field input:focus,
[data-theme="dark"] .yni-auth-field textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

[data-theme="dark"] .yni-auth-btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: 0 4px 16px rgba(201, 169, 110, 0.2);
}

[data-theme="dark"] .yni-auth-btn--primary:hover {
  background: var(--color-primary-hover);
}

[data-theme="dark"] .yni-auth-btn--ghost {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .yni-auth-btn--ghost:hover {
  background: var(--color-bg-hover);
}

[data-theme="dark"] .yni-auth-footer {
  color: var(--color-text-muted);
}

[data-theme="dark"] .yni-auth-footer a {
  color: var(--color-accent);
}

[data-theme="dark"] .yni-auth-divider::before,
[data-theme="dark"] .yni-auth-divider::after {
  background: var(--color-border);
}

[data-theme="dark"] .yni-auth-divider {
  color: var(--color-text-light);
}

[data-theme="dark"] .yni-auth-page .pass-strength-bar {
  background: var(--color-bg-hover);
}

[data-theme="dark"] .yni-auth-page .yni-auth-link {
  color: var(--color-accent);
}

