﻿/*
 * Auth page shell, avatar crop, and magic-link states
 * Refined after extracting shared form controls
 */

    .auth-page {
      max-width: 760px;
      margin: 3rem auto 4rem;
      display: block;
      padding: 0;
    }
    .auth-panel__kicker {
      font-size: 0.85rem;
      font-weight: 700;
      color: #b46f88;
    }
    .auth-panel__title {
      margin: 0;
      color: #5a4c42;
    }
    .auth-panel__hint,
    .auth-panel__foot,
    .auth-form__note {
      margin: 0;
      color: #7d6961;
      line-height: 1.75;
    }
    .auth-panel {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      min-width: 0;
      padding: 2.25rem;
      border: 1px solid rgba(232, 209, 203, 0.84);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 20px 48px rgba(168, 124, 140, 0.1);
      backdrop-filter: blur(10px);
    }
    .auth-panel__head {
      display: flex;
      flex-direction: column;
      gap: 0.55rem;
    }
    .auth-panel__title {
      font-size: 1.9rem;
      line-height: 1.16;
    }
    .auth-tabs {
      display: none;
    }
    .auth-tab {
      background: none;
      border: none;
      font-size: 1rem;
      cursor: pointer;
      padding: 0 0 0.75rem;
      color: #a08b84;
      font-weight: 600;
      line-height: 1;
    }
    .auth-tab.active {
      color: #6a5750;
      border-bottom: 2px solid #ff8bbd;
    }

    .auth-photo-field {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
    }
    .auth-photo-field__head {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }
    .auth-photo-field__row {
      display: flex;
      align-items: center;
      gap: 0.9rem;
      padding: 0.95rem;
      border: 1px solid rgba(232, 209, 203, 0.84);
      border-radius: 8px;
      background: rgba(255, 250, 248, 0.72);
    }
    .auth-photo-field.is-invalid .auth-photo-field__row {
      border-color: rgba(214, 102, 139, 0.88);
      background: rgba(255, 247, 249, 0.98);
      box-shadow: 0 0 0 3px rgba(214, 102, 139, 0.12);
    }
    .auth-photo-field__preview {
      width: 104px;
      height: 104px;
      flex: 0 0 104px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(255, 183, 205, 0.72);
      border-radius: 999px;
      overflow: hidden;
      background: linear-gradient(135deg, rgba(255, 244, 248, 0.98), rgba(255, 255, 255, 0.96));
      color: #b46f88;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
      cursor: pointer;
    }
    .auth-photo-field.is-invalid .auth-photo-field__preview {
      border-color: rgba(214, 102, 139, 0.9);
    }
    .auth-photo-field__preview img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }
    .auth-photo-field__preview i {
      font-size: 1.35rem;
    }
    .auth-photo-field__actions {
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.4rem;
    }
    .auth-photo-field__button {
      display: inline-flex;
      align-items: center;
      padding: 0.72rem 1rem;
      border: none;
      border-radius: 8px;
      background: linear-gradient(135deg, #ff92c7, #ff69b4);
      color: #fff;
      font: inherit;
      font-weight: 700;
      line-height: 1.1;
      cursor: pointer;
      box-shadow: 0 10px 22px rgba(255, 105, 180, 0.18);
      transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    }
    .auth-photo-field__button:hover {
      filter: saturate(1.04);
      box-shadow: 0 12px 24px rgba(255, 105, 180, 0.22);
      transform: translateY(-1px);
    }
    .auth-photo-field__button:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.16), 0 10px 22px rgba(255, 105, 180, 0.18);
    }
    .auth-photo-field__note {
      color: #8b756d;
      font-size: 0.82rem;
      line-height: 1.55;
    }
    body.auth-avatar-crop-open {
      overflow: hidden;
    }
    .auth-avatar-crop-modal {
      position: fixed !important;
      inset: 0;
      width: 100vw;
      height: 100vh;
      padding: clamp(16px, 3.5vw, 28px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2200;
      background-color: rgba(46, 35, 29, 0.46);
      backdrop-filter: blur(14px);
    }
    .auth-avatar-crop-card {
      width: min(92vw, 460px);
      padding: 1.25rem;
      display: grid;
      gap: 1rem;
      position: relative;
      border-radius: 8px;
      background: #fffaf7;
      border: 1px solid rgba(232, 209, 203, 0.98);
      box-shadow: 0 28px 56px rgba(65, 45, 38, 0.22);
    }
    .auth-avatar-crop__close {
      position: absolute;
      top: 0.7rem;
      right: 0.7rem;
      width: 36px;
      height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(232, 209, 203, 0.9);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.92);
      color: #8a6d71;
      cursor: pointer;
    }
    .auth-avatar-crop__header {
      display: grid;
      gap: 0.35rem;
      padding-right: 2.5rem;
    }
    .auth-avatar-crop__header h3 {
      margin: 0;
      color: #5a4c42;
      font-size: 1.08rem;
      font-weight: 700;
    }
    .auth-avatar-crop__header p {
      margin: 0;
      color: #8b756d;
      font-size: 0.88rem;
      line-height: 1.55;
    }
    .auth-avatar-crop__stage {
      position: relative;
      width: min(76vw, 320px);
      aspect-ratio: 1;
      margin: 0 auto;
      overflow: hidden;
      border-radius: 8px;
      background: linear-gradient(135deg, rgba(252, 245, 243, 1), rgba(255, 255, 255, 1));
      box-shadow: inset 0 0 0 1px rgba(236, 214, 214, 0.98);
      touch-action: none;
      cursor: grab;
      user-select: none;
    }
    .auth-avatar-crop-card.is-loading .auth-avatar-crop__stage {
      cursor: progress;
    }
    .auth-avatar-crop__stage.is-dragging {
      cursor: grabbing;
    }
    .auth-avatar-crop__image,
    .auth-avatar-crop__veil,
    .auth-avatar-crop__ring {
      position: absolute;
      inset: 0;
    }
    .auth-avatar-crop__image {
      background-repeat: no-repeat;
      background-position: center;
      background-size: cover;
      will-change: background-position, background-size;
    }
    .auth-avatar-crop__loading {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.2rem;
      text-align: center;
      color: #735f57;
      font-size: 0.92rem;
      line-height: 1.6;
      background: rgba(255, 250, 248, 0.96);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.18s ease;
      z-index: 1;
    }
    .auth-avatar-crop-card.is-loading .auth-avatar-crop__loading {
      opacity: 1;
    }
    .auth-avatar-crop-card.is-loading .auth-avatar-crop__image {
      opacity: 0.18;
    }
    .auth-avatar-crop__veil {
      pointer-events: none;
      inset: 14px;
      border-radius: 999px;
      box-shadow: 0 0 0 999px rgba(255, 250, 248, 0.94);
    }
    .auth-avatar-crop__ring {
      pointer-events: none;
      inset: 14px;
      border-radius: 999px;
      border: 2px solid rgba(255, 255, 255, 0.94);
    }
    .auth-avatar-crop__slider {
      display: grid;
      gap: 0.55rem;
    }
    .auth-avatar-crop__slider span {
      color: #735f57;
      font-size: 0.86rem;
      font-weight: 700;
    }
    .auth-avatar-crop__slider input[type="range"] {
      width: 100%;
      accent-color: #ff69b4;
    }
    .auth-avatar-crop__actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 0.65rem;
    }
    .auth-avatar-crop__button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 0.7rem 1rem;
      border: none;
      border-radius: 8px;
      background: linear-gradient(135deg, #ff92c7, #ff69b4);
      color: #fff;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 10px 20px rgba(255, 105, 180, 0.16);
    }
    .auth-avatar-crop__button--ghost {
      background: rgba(255, 255, 255, 0.96);
      color: #775f5e;
      border: 1px solid rgba(232, 209, 203, 0.9);
      box-shadow: none;
    }

    #loginPageSubmit,
    #registerPageSubmit {
      width: 100%;
      padding: 0.95rem 1.1rem;
      border-radius: 8px;
      background: linear-gradient(135deg, #ff92c7, #ff69b4);
      color: #fff;
      border: none;
      font-size: 1rem;
      font-weight: 700;
      cursor: pointer;
      margin-top: 0.2rem;
      box-shadow: 0 14px 30px rgba(255, 105, 180, 0.24);
    }
    #loginPageSubmit:hover,
    #registerPageSubmit:hover {
      background: linear-gradient(135deg, #ff86c0, #ff4fa6);
    }
    .auth-link-state {
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
      padding: 0.65rem 0 0;
      background: transparent;
      box-shadow: none;
    }
    .auth-link-state__copy {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      min-width: 0;
    }
    .auth-link-state__meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.55rem;
      min-width: 0;
    }
    .auth-link-state__meta[hidden] {
      display: none;
    }
    .auth-link-state__copy strong {
      color: #5a4c42;
      font-size: 0.96rem;
      line-height: 1.35;
    }
    .auth-link-state__copy p {
      margin: 0;
      color: #7d6961;
      font-size: 0.88rem;
      line-height: 1.6;
    }
    .auth-link-state__email {
      display: inline-flex;
      align-items: center;
      align-self: flex-start;
      min-width: 0;
      padding: 0.38rem 0.62rem;
      border-radius: 999px;
      background: rgba(255, 237, 245, 0.98);
      color: #a55c7a;
      font-size: 0.82rem;
      font-weight: 700;
      line-height: 1.2;
      word-break: break-all;
    }
    .auth-link-state__email[hidden] {
      display: none;
    }
    .auth-link-state__email:empty {
      display: none;
    }
    .auth-link-state__link {
      display: inline-flex;
      align-items: center;
      padding: 0;
      border: none;
      background: transparent;
      color: #b46f88;
      font: inherit;
      font-size: 0.84rem;
      font-weight: 700;
      line-height: 1.2;
      cursor: pointer;
      white-space: nowrap;
      transition: color 0.18s ease, opacity 0.18s ease;
    }
    .auth-link-state__link:disabled {
      opacity: 0.58;
      cursor: default;
    }
    .auth-link-state__link:hover {
      color: #955f73;
    }
    .auth-link-state__link:focus-visible {
      outline: none;
      color: #955f73;
      text-decoration: underline;
      text-underline-offset: 0.14em;
    }
    .auth-link-state__actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.38rem 0.55rem;
      padding-top: 0.02rem;
    }
    .auth-link-state__actions-label {
      color: #8b756d;
      font-size: 0.84rem;
      line-height: 1.4;
    }
    .auth-link-state__divider {
      width: 1px;
      height: 0.82rem;
      background: rgba(220, 198, 205, 0.92);
    }
    .auth-form__note {
      font-size: 0.92rem;
    }
    .auth-form__note-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
    }
    .auth-form__note-row .auth-form__note {
      flex: 1 1 auto;
      min-width: 0;
    }
    .auth-form__note-actions {
      display: flex;
      flex: 0 0 auto;
      justify-content: flex-end;
      min-width: max-content;
    }
    .auth-form__note-actions[hidden] {
      display: none;
    }
    .auth-form__note-actions.auth-link-state__actions {
      padding-top: 0;
    }
    .auth-panel__foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      padding-top: 1rem;
      border-top: 1px solid rgba(226, 203, 197, 0.72);
      font-size: 0.94rem;
    }
    .auth-inline-switch {
      border: none;
      background: transparent;
      color: #b46f88;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }
    .auth-inline-switch:hover {
      color: #9f5f78;
    }
    .auth-page[data-auth-mode="register"] .auth-panel {
      border-color: rgba(232, 209, 203, 0.84);
    }
    .auth-page[data-auth-mode="register"] .auth-panel__kicker {
      color: #b46f88;
    }
    @media (max-width: 980px) {
      .auth-page {
        max-width: 100%;
      }
      .auth-panel {
        padding: 1.5rem;
      }
    }
    @media (max-width: 720px) {
      .auth-page {
        margin: 2rem auto;
      }
      .auth-photo-field__row {
        flex-direction: column;
        align-items: flex-start;
      }
      .auth-photo-field__preview {
        width: 108px;
        height: 108px;
        flex-basis: 108px;
      }
      .auth-photo-field__actions {
        width: 100%;
      }
      .auth-photo-field__button {
        width: 100%;
        justify-content: center;
      }
      .auth-avatar-crop-card {
        width: min(94vw, 420px);
        padding: 1rem;
      }
      .auth-avatar-crop__stage {
        width: min(84vw, 300px);
      }
      .auth-avatar-crop__actions {
        display: grid;
        grid-template-columns: 1fr;
      }
      .auth-avatar-crop__button {
        width: 100%;
      }
      .auth-panel__title {
        font-size: 1.55rem;
      }
      .auth-panel__foot {
        flex-direction: column;
        align-items: flex-start;
      }
      .auth-form__note-row {
        flex-direction: column;
        gap: 0.4rem;
      }
      .auth-form__note-actions {
        width: 100%;
        justify-content: flex-start;
      }
      .auth-link-state__meta {
        align-items: flex-start;
      }
      .auth-link-state__actions {
        width: 100%;
      }
      .auth-link-state__divider {
        display: none;
      }
    }

