/* Rubyam Hair — Auth screens (shared customer + admin login) */

:root {
  --auth-navy: #0C0935;
  --auth-cream: #EFE7D8;
  --auth-white: #FFFFFF;
  --auth-gray-dark: #494949;
  --auth-gray: #8B94A3;
  --auth-gold-dark: #69481D;
  --auth-gold: #FBDF9D;
  --auth-form-bg: #FCFBF8;
  --auth-border: #D9D9D9;
  --auth-font-display: "Cormorant Garamond", Georgia, serif;
  --auth-font-ui: "Montserrat", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.auth-body {
  margin: 0;
  min-height: 100%;
  font-family: var(--auth-font-ui);
  color: var(--auth-navy);
  background: var(--auth-white);
  -webkit-font-smoothing: antialiased;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  width: 100%;
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 280px;
  background: var(--auth-navy);
  color: var(--auth-cream);
  overflow: hidden;
  padding: 2rem 1.5rem;
}

.auth-visual__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-visual__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-visual__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(12, 9, 53, 0.2) 0%,
    rgba(12, 9, 53, 0.55) 100%
  );
}

.auth-visual__content {
  position: relative;
  z-index: 2;
  max-width: 420px;
  width: 100%;
}

.auth-brand {
  margin-bottom: 1.5rem;
}

.auth-brand__logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}

.auth-brand__line {
  width: 48px;
  height: 2px;
  background: var(--auth-gold);
  margin: 1.25rem 0 1rem;
  border: 0;
}

.auth-visual__title {
  font-family: var(--auth-font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--auth-white);
  letter-spacing: 0.01em;
}

.auth-visual__subtitle {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(239, 231, 216, 0.92);
  margin: 0;
  white-space: pre-line;
}

.auth-visual__benefits {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.auth-visual__benefits li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  color: rgba(251, 223, 157, 0.95);
}

.auth-visual__benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-gold);
}

.auth-visual__footer {
  margin-top: 1.75rem;
  font-family: var(--auth-font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--auth-gold);
}

.auth-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--auth-form-bg);
  padding: 1.5rem;
  min-width: 0;
}

.auth-card {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.auth-card__mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.auth-card__mark img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.auth-card__mark span {
  font-family: var(--auth-font-display);
  font-size: 1.125rem;
  color: var(--auth-navy);
}

.auth-card__title {
  font-family: var(--auth-font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 500;
  margin: 0 0 0.5rem;
  color: var(--auth-navy);
}

.auth-card__subtitle {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--auth-gray);
  margin: 0 0 1.75rem;
  white-space: pre-line;
}

.auth-tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid #E8E4DC;
}

.auth-tabs a {
  position: relative;
  display: inline-block;
  padding: 0.75rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--auth-gray);
  transition: color 200ms ease;
}

.auth-tabs a:hover {
  color: var(--auth-navy);
}

.auth-tabs a.is-active {
  color: var(--auth-navy);
}

.auth-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--auth-gold);
}

.auth-alert {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.auth-alert--error {
  background: #FFF5F5;
  border: 1px solid #F1B4B4;
  color: #8B1E1E;
}

.auth-alert--success {
  background: #F2F8F3;
  border: 1px solid #B7D7BE;
  color: #1F5C2E;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--auth-navy);
}

.auth-field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__control .auth-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--auth-gray);
  pointer-events: none;
}

.auth-field__control .auth-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-gray);
  cursor: pointer;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-field__control .auth-toggle-password:hover,
.auth-field__control .auth-toggle-password:focus-visible {
  color: var(--auth-navy);
  outline: none;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  height: 56px;
  padding: 16px 16px 16px 46px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-white);
  font-family: var(--auth-font-ui);
  font-size: 0.9375rem;
  color: var(--auth-navy);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.auth-field input.has-toggle {
  padding-right: 48px;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-gold-dark);
  box-shadow: 0 0 0 3px rgba(105, 72, 29, 0.08);
}

.auth-field input:focus-visible {
  outline: none;
  border-color: var(--auth-gold-dark);
  box-shadow: 0 0 0 3px rgba(105, 72, 29, 0.08);
}

.auth-field__error {
  font-size: 0.75rem;
  color: #8B1E1E;
}

.auth-field__hint {
  font-size: 0.75rem;
  color: var(--auth-gray);
}

.auth-field__rules {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  font-size: 0.75rem;
  color: var(--auth-gray);
}

.auth-field__rules li.is-ok {
  color: #1F5C2E;
}

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.5rem;
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.8125rem;
  color: var(--auth-gray-dark);
  line-height: 1.45;
}

.auth-check input {
  margin-top: 0.15rem;
  accent-color: var(--auth-gold-dark);
}

.auth-link {
  font-size: 0.8125rem;
  color: var(--auth-gold-dark);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--auth-gold-dark);
  color: var(--auth-white);
  font-family: var(--auth-font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: var(--auth-navy);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.75;
  cursor: wait;
}

.auth-submit--admin {
  background: var(--auth-navy);
}

.auth-submit--admin:hover:not(:disabled) {
  background: var(--auth-gold-dark);
}

.auth-submit__arrow {
  width: 18px;
  height: 18px;
}

.auth-submit__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}

.auth-submit.is-loading .auth-submit__spinner {
  display: inline-block;
}

.auth-submit.is-loading .auth-submit__arrow {
  display: none;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
  color: var(--auth-gray);
  font-size: 0.75rem;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E8E4DC;
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--auth-gray-dark);
}

.auth-security {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  background: #F5F1EA;
  border-radius: 8px;
}

.auth-security__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--auth-gold-dark);
  margin-top: 0.1rem;
}

.auth-security strong {
  display: block;
  font-size: 0.875rem;
  color: var(--auth-navy);
  margin-bottom: 0.2rem;
}

.auth-security p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--auth-gray-dark);
  line-height: 1.45;
}

.auth-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #E8E4DC;
  text-align: center;
}

.auth-footer__copy {
  margin: 0;
  font-size: 0.75rem;
  color: var(--auth-gray);
}

.auth-footer__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--auth-gray);
}

@media (min-width: 768px) {
  .auth-layout {
    grid-template-columns: 42% 58%;
  }

  .auth-visual {
    min-height: 100vh;
    align-items: center;
    padding: 3rem 2.5rem;
  }

  .auth-brand__logo {
    max-width: 190px;
    max-height: 76px;
  }

  .auth-content {
    padding: 2.5rem;
  }

  .auth-form__row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .auth-layout {
    grid-template-columns: 1fr 1fr;
  }

  .auth-visual {
    padding: 4rem 3.5rem;
  }

  .auth-brand__logo {
    max-width: 220px;
    max-height: 88px;
  }

  .auth-content {
    padding: 4rem 5rem;
  }
}

@media (max-width: 767px) {
  .auth-visual {
    min-height: 260px;
    max-height: 340px;
  }

  .auth-visual__title {
    font-size: 1.65rem;
  }

  .auth-visual__benefits {
    display: none;
  }
}
