/*
 * StellaDesign theme - sd-auth
 * 1. Form fields rendered by templates/_partials/form-fields.tpl (all pages).
 * 2. Split screen layout (templates/layouts/layout-auth.tpl, mockup 2).
 * 3. Login, registration and password pages content.
 * 4. Company / SIRET autocomplete.
 */

/* ================================================================== 1. fields */

.sd-field { margin-bottom: 1.1rem; }
.sd-field > .form-control-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding-top: 0;
  margin-bottom: .45rem;
  text-align: left;
  font-size: .875rem;
  font-weight: 700;
  color: var(--sd-fg);
}
.sd-optional {
  font-size: .75rem;
  font-weight: 500;
  color: var(--sd-muted);
}
.sd-field__control { position: relative; }
.sd-field .form-control { width: 100%; }
/* classic adds padding-top to .form-control-comment and <p> keeps a bottom margin: keep one small gap only */
.sd-field__comment,
.sd-field .form-control-comment.sd-field__comment {
  display: block;
  margin: .35rem 0 0;
  padding-top: 0;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--sd-muted);
}

/* Leading icon (login e-mail, password, company search) */
.sd-field__icon {
  position: absolute;
  z-index: 4;
  top: .9rem;
  left: .95rem;
  width: 1.2rem;
  height: 1.2rem;
  color: var(--sd-muted);
  pointer-events: none;
}
.sd-field .form-control.sd-field__input--icon { padding-left: 2.85rem; }

/* Password with show / hide button */
.sd-field .sd-password.input-group { display: block; position: relative; width: 100%; }
.sd-field .sd-password.input-group.focus { outline: 0; }
.sd-field .sd-password .form-control,
.sd-field .sd-password .form-control:not(:last-child) {
  float: none;
  border-radius: .75rem;
  padding-right: 3.1rem;
}
.sd-password__toggle {
  position: absolute;
  z-index: 4;
  top: .4rem;
  right: .4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: var(--sd-muted);
  cursor: pointer;
}
.sd-password__toggle:hover { color: var(--sd-primary); background: var(--sd-surface); }
.sd-password__toggle:focus { outline: none; }
.sd-password__toggle:focus-visible { box-shadow: var(--sd-ring); color: var(--sd-primary); }
.sd-password__toggle svg { width: 1.25rem; height: 1.25rem; }
/* Mockup: slashed eye while the password is hidden */
.sd-password__toggle .sd-password__eye { display: none; }
.sd-password__toggle.is-visible .sd-password__eye { display: block; }
.sd-password__toggle.is-visible .sd-password__eye-off { display: none; }

/* Selects */
.sd-field select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23716a80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 1.1rem;
}
.sd-birthday { display: flex; gap: .5rem; }
.sd-birthday select { flex: 1; min-width: 0; }

/* Checkboxes (newsletter, GDPR, partner offers...) */
.sd-field--type-checkbox .custom-checkbox { display: block; }
.sd-field--type-checkbox .custom-checkbox label,
#authentication .sd-field--type-checkbox .custom-checkbox label {
  display: block;
  position: relative;
  margin: 0;
  padding-left: 1.85rem;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--sd-muted);
  cursor: pointer;
}
.sd-field--type-checkbox .custom-checkbox label em { display: block; margin-top: .2rem; font-size: .8rem; font-style: normal; }
.sd-field--type-checkbox .custom-checkbox label > span { position: absolute; left: 0; top: .1rem; }
.sd-field--type-checkbox .custom-checkbox label br { display: none; }
.sd-field--type-checkbox .custom-checkbox label strong, .sd-field--type-checkbox .custom-checkbox label i:not(.material-icons),
.sd-field--type-checkbox .custom-checkbox label i:not(.material-icons) { font-style: normal; }
.sd-field .custom-checkbox input[type="checkbox"] { margin-top: .15rem; }
.sd-field .custom-checkbox input[type="checkbox"] + span {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  margin: .1rem 0 0;
  border: 1.5px solid var(--sd-border);
  border-radius: .35rem;
  background: #fff;
}
.sd-field .custom-checkbox input[type="checkbox"]:checked + span {
  background: var(--sd-accent);
  border-color: var(--sd-accent);
}
.sd-field .custom-checkbox input[type="checkbox"] + span .checkbox-checked {
  margin: -.12rem -.1rem;
  font-size: 1.05rem;
  color: #fff;
}
.sd-field .custom-checkbox input[type="checkbox"]:focus-visible + span { box-shadow: var(--sd-ring); border-color: var(--sd-accent); }

/* Radios kept for other radio fields */
.sd-radio-group { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding-top: .25rem; }
.sd-radio-group .radio-inline { font-weight: 500; margin: 0; }

/* Errors */
.sd-field.has-error .form-control { border-color: var(--sd-danger); }
.sd-field.has-error .form-control:focus { box-shadow: 0 0 0 4px rgba(215, 56, 77, .12); }
.sd-field .help-block { margin: .4rem 0 0; }
.sd-field .help-block ul { margin: 0; padding: 0; list-style: none; }
.sd-field .help-block .alert {
  margin: 0;
  padding: .45rem .7rem;
  font-size: .8rem;
  border-radius: .6rem;
}

/* ================================================================== 2. layout */

.sd-auth-page { background: var(--sd-bg); }

.sd-auth {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  min-height: 100vh;
}
.sd-auth__panel { grid-column: 1; grid-row: 1; }
.sd-auth__main { grid-column: 2; grid-row: 1; }

/* Left dark panel */
.sd-auth__panel { color: #fff; background: var(--sd-hero); }
.sd-auth__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden auto;
  background:
    radial-gradient(55% 45% at 82% 0%, rgba(113, 65, 232, .55), rgba(113, 65, 232, 0) 70%),
    radial-gradient(45% 40% at 100% 100%, rgba(113, 65, 232, .45), rgba(113, 65, 232, 0) 70%),
    radial-gradient(40% 35% at 0% 60%, rgba(93, 43, 196, .18), rgba(93, 43, 196, 0) 70%),
    linear-gradient(165deg, var(--sd-hero) 0%, #22105a 55%, var(--sd-hero) 100%);
}
.sd-auth__deco {
  position: absolute;
  right: -2rem;
  bottom: -1rem;
  width: 64%;
  max-width: 34rem;
  height: auto;
  pointer-events: none;
  opacity: .85;
}
.sd-auth__panel-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  min-height: 100%;
  padding: 3rem clamp(2rem, 5vw, 4.75rem) 2.75rem;
}
.sd-auth__panel a:focus-visible { outline: 2px solid var(--sd-violet-300); outline-offset: 3px; border-radius: .5rem; }

.sd-auth__logo { display: inline-flex; align-self: flex-start; }
.sd-auth__logo img { display: block; width: auto; height: 2.4rem; }

.sd-auth__intro { margin-top: auto; }
.sd-auth__eyebrow {
  margin: 0 0 .9rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sd-violet-300);
}
.sd-auth-page .sd-auth__headline {
  margin: 0 0 1.1rem;
  max-width: 44rem;
  font-size: clamp(2rem, 2.9vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: #fff;
}
.sd-auth__lead {
  margin: 0;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--sd-violet-200);
}

/* Partner program card */
.sd-auth__partner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.1rem 1.25rem;
  max-width: 41rem;
  padding: 1.25rem;
  border: 1px solid rgba(196, 181, 253, .28);
  border-radius: var(--sd-radius-lg);
  background: rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sd-auth__partner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1rem;
  background: rgba(113, 65, 232, .45);
  color: #fff;
}
.sd-auth__partner-icon svg { width: 2rem; height: 2rem; }
.sd-auth__partner-text p { margin: 0; font-size: .875rem; line-height: 1.55; color: var(--sd-violet-200); }
.sd-auth__partner-text .sd-auth__partner-title {
  margin-bottom: .3rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
}
.sd-auth__partner-cta { white-space: nowrap; }

/* Testimonial */
.sd-auth__quote {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 40rem;
  margin: 0;
}
.sd-auth__quote-photo {
  flex: none;
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, .18);
}
.sd-auth__quote blockquote { margin: 0 0 .65rem; }
.sd-auth__quote blockquote p {
  margin: 0;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: rgba(255, 255, 255, .92);
}
.sd-auth__quote figcaption strong { display: block; font-size: 1rem; font-weight: 800; color: #fff; }
.sd-auth__quote figcaption span { font-size: .85rem; color: var(--sd-violet-300); }

/* Reassurance icons */
.sd-auth__assets {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sd-auth__assets li {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0 1.6rem;
  border-left: 1px solid rgba(255, 255, 255, .18);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.sd-auth__assets li:first-child { padding-left: 0; border-left: 0; }
.sd-auth__assets svg { flex: none; width: 1.9rem; height: 1.9rem; color: var(--sd-violet-200); }
.sd-auth__assets span { max-width: 7.5rem; }

/* Right column */
.sd-auth__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--sd-bg);
}
.sd-auth__topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 2.25rem clamp(1.5rem, 4vw, 3.5rem) 0;
}
.sd-auth__mobile-logo { display: none; }
.sd-auth__back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .25rem;
  border-radius: .5rem;
  font-size: .9rem;
  font-weight: 800;
  color: var(--sd-link);
  text-decoration: none;
}
.sd-auth__back:hover, .sd-auth__back:focus { color: var(--sd-primary); }
.sd-auth__back:focus-visible { outline: none; box-shadow: var(--sd-ring); }
.sd-auth__back .sd-icon { width: 1.15rem; height: 1.15rem; }

.sd-auth__body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem 4rem;
}
.sd-auth__inner { width: 100%; max-width: 30.5rem; }

.sd-auth #notifications .container { width: auto; max-width: none; padding: 0; }
.sd-auth #notifications .alert { margin-bottom: 1.25rem; }
.sd-auth #wrapper.sd-auth__wrapper { padding: 0; background: transparent; box-shadow: none; }

/* ================================================================== 3. content */

.sd-auth-page #main .page-content,
.sd-auth-page #main #content.page-content.card {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: .95rem;
  color: var(--sd-fg);
}
.sd-auth-page #main .sd-auth-head { margin: 0 0 2.25rem; }
.sd-auth-page #main .sd-auth-head h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--sd-fg);
}
.sd-auth-head__lead { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--sd-muted); }

.sd-auth-page .form-footer { margin-top: 1.75rem; padding: 0; text-align: left; }
.sd-auth-page .sd-auth-submit,
.sd-auth-page .form-footer .btn-primary {
  float: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: .75rem 1.25rem;
  border-radius: .75rem;
  font-size: .95rem;
  font-weight: 700;
}
.sd-auth-page .sd-auth-submit:focus-visible { outline: none; box-shadow: var(--sd-ring); }

.sd-auth-page .sd-forgot-password,
.sd-auth-page #content .forgot-password {
  margin: -.35rem 0 0;
  padding: 0;
  text-align: right;
  font-size: .9rem;
}
.sd-forgot-password a { font-weight: 800; color: var(--sd-link); }

.sd-auth-switch,
.sd-auth-page #content .no-account {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: .95rem;
  color: var(--sd-muted);
}
.sd-auth-switch a { font-weight: 800; color: var(--sd-link); }
.sd-auth-switch a:hover, .sd-auth-switch a:focus { color: var(--sd-primary); }
.sd-auth-page .page-footer { margin: 0; }

/* Registration: first and last name side by side */
.sd-auth-page .sd-customer-form__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 1rem;
}
.sd-auth-page .sd-customer-form__fields > * { grid-column: 1 / -1; }
.sd-auth-page .sd-customer-form__fields > .sd-field--firstname,
.sd-auth-page .sd-customer-form__fields > .sd-field--lastname { grid-column: auto; }

/* Password pages alerts (classic ps-alert-*) */
.sd-auth-page .ps-alert-error,
.sd-auth-page .ps-alert-success { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.sd-auth-page .ps-alert-error .item,
.sd-auth-page .ps-alert-success .item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin: 0 0 .75rem;
  padding: .85rem 1rem;
  border: 1px solid #f6c9d1;
  border-radius: var(--sd-radius);
  background: #fdecef;
}
.sd-auth-page .ps-alert-success .item { border-color: #bfe8d5; background: #e8f7f0; }
.sd-auth-page .ps-alert-error .item i,
.sd-auth-page .ps-alert-success .item i { display: flex; border: 0; }
.sd-auth-page .ps-alert-error .item i svg,
.sd-auth-page .ps-alert-success .item i svg {
  width: 1.4rem;
  height: 1.4rem;
  padding: .2rem;
  border-radius: 50%;
  background-color: var(--sd-danger);
}
.sd-auth-page .ps-alert-success .item i svg { background-color: var(--sd-success); }
.sd-auth-page .ps-alert-error .item p,
.sd-auth-page .ps-alert-success .item p {
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  font-size: .9rem;
  color: #9b1c31;
}
.sd-auth-page .ps-alert-success .item p { color: var(--sd-success); }
.sd-auth-page .forgotten-password { padding: 0; }
.sd-auth-page .sd-auth-form .sd-auth-submit { margin-top: 1.5rem; }

/* ================================================================== 4. company */

.sd-company__combo { position: relative; }
.sd-company__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  max-height: 18rem;
  margin: 0;
  padding: .35rem;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--sd-border);
  border-radius: .75rem;
  background: #fff;
  box-shadow: var(--sd-shadow-lg);
}
.sd-company__option {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .6rem .75rem;
  border-radius: .55rem;
  cursor: pointer;
}
.sd-company__option:hover,
.sd-company__option.is-active { background: var(--sd-surface-2); }
.sd-company__name { font-size: .9rem; font-weight: 700; color: var(--sd-fg); }
.sd-company__meta { font-size: .78rem; line-height: 1.4; color: var(--sd-muted); }
.sd-company__empty { padding: .7rem .75rem; font-size: .85rem; color: var(--sd-muted); }
.sd-field .form-control.sd-siret { background: var(--sd-surface-3); }
.sd-field .form-control.sd-siret:focus { background: #fff; }

/* ================================================================== responsive */

@media (max-width: 1279px) {
  .sd-auth__partner { grid-template-columns: auto minmax(0, 1fr); }
  .sd-auth__partner-cta { grid-column: 2; justify-self: start; }
}

@media (max-width: 991px) {
  .sd-auth { display: block; min-height: 0; }
  .sd-auth__main { min-height: 0; }

  .sd-auth__topbar {
    justify-content: space-between;
    padding: .85rem 1.25rem;
    background: var(--sd-hero);
  }
  .sd-auth__mobile-logo { display: inline-flex; }
  .sd-auth__mobile-logo img { display: block; width: auto; height: 1.75rem; }
  .sd-auth__mobile-logo:focus-visible { outline: 2px solid var(--sd-violet-300); outline-offset: 3px; }
  .sd-auth__back { color: #fff; font-size: .82rem; }
  .sd-auth__back:hover, .sd-auth__back:focus { color: var(--sd-violet-200); }
  .sd-auth__back:focus-visible { box-shadow: none; outline: 2px solid var(--sd-violet-300); }

  .sd-auth__body { display: block; padding: 2.25rem 1.25rem 3rem; }
  .sd-auth__inner { margin: 0 auto; }

  .sd-auth__sticky { position: relative; height: auto; overflow: hidden; }
  .sd-auth__panel-inner { padding: 3rem 1.25rem 2.5rem; gap: 2rem; }
  .sd-auth__logo { display: none; }
  .sd-auth__deco { width: 90%; opacity: .5; }
}

@media (max-width: 575px) {
  .sd-auth__back-brand { display: none; }
  .sd-auth-page .sd-customer-form__fields { display: block; }
  .sd-auth-page .sd-auth__headline { font-size: 1.75rem; }
  .sd-auth__partner { grid-template-columns: 1fr; padding: 1.1rem; }
  .sd-auth__partner-icon { width: 3.25rem; height: 3.25rem; }
  .sd-auth__partner-icon svg { width: 1.6rem; height: 1.6rem; }
  .sd-auth__partner-cta { grid-column: auto; }
  .sd-auth__quote { align-items: flex-start; gap: 1rem; }
  .sd-auth__quote-photo { width: 4rem; height: 4rem; }
  .sd-auth__assets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .sd-auth__assets li { flex-direction: column; align-items: flex-start; gap: .5rem; padding: 0 .85rem; font-size: .8rem; }
  .sd-auth__assets svg { width: 1.6rem; height: 1.6rem; }
}
