/* ==========================================================================
   Sanskriti account pages - heritage reading-room edition
   ========================================================================== */

/* Keyframe animations */
@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpCard {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 12px 30px rgba(20,8,3,.4), inset 0 0 30px rgba(238,204,137,.15);
  }
  50% {
    box-shadow: 0 16px 40px rgba(20,8,3,.5), inset 0 0 40px rgba(238,204,137,.25);
  }
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fadeInSheet {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.auth-page main {
  position: relative;
  isolation: isolate;
}

.auth-stage {
  position: relative;
  min-height: calc(100vh - 126px);
  padding: clamp(3rem,7vw,6rem) 0;
  overflow: hidden;
  animation: fadeInPage 0.6s ease-out;
}

.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 12% 16%,rgba(120,65,28,.16),transparent 31%),
    radial-gradient(ellipse at 88% 84%,rgba(112,46,38,.12),transparent 28%),
    repeating-linear-gradient(0deg,rgba(95,57,25,.026) 0 1px,transparent 1px 5px),
    linear-gradient(105deg,#d9b77d,#f7e3b5 48%,#d2a967);
}

.auth-stage::after {
  content: "";
  position: absolute;
  inset: 22px;
  z-index: -1;
  border: 1px solid rgba(101,57,24,.34);
  box-shadow: inset 0 0 68px rgba(70,34,12,.12);
  pointer-events: none;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0,.9fr) minmax(430px,1.1fr);
  width: min(1120px,calc(100% - 2rem));
  margin-inline: auto;
  border: 1px solid rgba(80,42,18,.52);
  border-radius: 4px 12px 5px 9px;
  box-shadow: 0 28px 62px rgba(56,27,9,.24),inset 0 0 0 1px rgba(255,239,194,.38);
  animation: slideUpCard 0.8s ease-out;
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 680px;
  padding: clamp(2.5rem,5vw,4.5rem);
  overflow: hidden;
  color: #f4ddb0;
  background:
    radial-gradient(circle at 78% 18%,rgba(211,169,90,.2),transparent 26%),
    repeating-linear-gradient(90deg,rgba(255,230,170,.025) 0 1px,transparent 1px 6px),
    linear-gradient(145deg,#6f3d2b,#452318 62%,#2e170f);
  border-radius: 3px 0 0 8px;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  color: rgba(224,183,100,.32);
  font: 5rem Georgia,serif;
}

.auth-story::before { content: "❦"; top: 1.1rem; right: 1.5rem; }
.auth-story::after { content: "❦"; right: 1.5rem; bottom: 1rem; transform: rotate(180deg); }

.auth-story-brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  width: fit-content;
  color: #f4ddb0;
  text-decoration: none;
}

.auth-story-brand img {
  width: 62px;
  height: 62px;
  padding: 4px;
  object-fit: contain;
  background: #ead4a4;
  border: 1px solid #c99b53;
  border-radius: 2px 7px 3px 6px;
}

.auth-story-visual {
  margin-bottom: 2rem;
  position: relative;
}
.auth-story-image {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(circle at 50% 50%, rgba(218,174,97,.3), transparent 60%),
    linear-gradient(145deg, #6f3d2b, #452318 62%, #2b160f);
  border: 2px solid #c99b53;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(20,8,3,.4), inset 0 0 30px rgba(238,204,137,.15);
  animation: pulseGlow 3s ease-in-out infinite;
}
.auth-story-image img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
}
.auth-story-decoration {
  position: absolute;
  inset: -20px;
  pointer-events: none;
}
.auth-story-decoration i {
  position: absolute;
  color: rgba(218,174,97,.6);
  font-size: 1.5rem;
  animation: floatIcon 3s ease-in-out infinite;
  transition: color 0.3s ease;
}
.auth-story-decoration i:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 0s;
}
.auth-story-decoration i:nth-child(2) {
  top: 50%;
  right: -25px;
  transform: translateY(-50%);
  animation-delay: 1s;
}
.auth-story-decoration i:nth-child(3) {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 2s;
}
.auth-story:hover .auth-story-decoration i {
  color: rgba(218,174,97,.9);
}

.auth-story-brand b {
  display: block;
  font: 700 1.35rem/1 "Playfair Display",Georgia,serif;
}

.auth-story-brand span {
  display: block;
  margin-top: .28rem;
  color: #d4ad69;
  font: 700 .63rem Georgia,serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-story-copy {
  position: relative;
  z-index: 1;
}

.auth-story-copy .eyebrow { color: #dcb872; }
.auth-page .auth-story-copy h1 {
  max-width: 10ch;
  margin: .75rem 0 1rem;
  color: #fff0c8;
  font-size: clamp(2.75rem,5vw,4.45rem);
  line-height: 1.02;
}

.auth-page .auth-story-copy > p {
  max-width: 38ch;
  margin: 0;
  color: #dcc39a;
  font: 1rem/1.8 Georgia,serif;
}

.auth-promises {
  display: grid;
  gap: .75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.auth-page .auth-promises li {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #ead3a7;
  font: .82rem/1.45 Georgia,serif;
}

.auth-promises i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: #4d281a;
  background: #d4aa61;
  border: 1px solid #f0d59b;
  border-radius: 50%;
}

.auth-page .auth-quote {
  position: relative;
  z-index: 1;
  margin: 2rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(228,190,116,.35);
  color: #cdb387;
  font: italic .84rem/1.65 Georgia,serif;
}

.auth-sheet {
  position: relative;
  padding: clamp(2.2rem,5vw,4.25rem);
  background:
    radial-gradient(ellipse at 100% 0,rgba(112,62,22,.12),transparent 34%),
    repeating-linear-gradient(0deg,rgba(91,57,25,.026) 0 1px,transparent 1px 4px),
    linear-gradient(105deg,#dfc188,#f8e4b4 52%,#d7b575);
  border-radius: 0 11px 4px 0;
  animation: fadeInSheet 1s ease-out 0.3s both;
  overflow: hidden;
}

.auth-sheet::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(112,66,29,.23);
  pointer-events: none;
}

.auth-sheet::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(112,66,29,.23);
  pointer-events: none;
}

.auth-sheet-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin-inline: auto;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-heading { 
  margin-bottom: 1.7rem;
  animation: fadeInDown 0.8s ease-out 0.5s both;
}
.auth-heading .eyebrow { color: var(--manuscript-red); }
.auth-heading h2 {
  margin: .55rem 0 .65rem;
  color: var(--manuscript-red-dark);
  font-size: clamp(2.2rem,4vw,3.3rem);
}
.auth-heading p {
  margin: 0;
  color: #6a5139;
  font: .95rem/1.7 Georgia,serif;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.3rem 0;
  color: #8d6736;
  font: 700 .62rem Georgia,serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(115,67,29,.48));
}
.auth-divider::after { background: linear-gradient(270deg,transparent,rgba(115,67,29,.48)); }

.auth-form {
  display: grid;
  gap: 1rem;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1rem;
}

.auth-field { 
  min-width: 0;
  animation: fadeInUp 0.6s ease-out both;
}
.auth-field:nth-child(1) { animation-delay: 0.1s; }
.auth-field:nth-child(2) { animation-delay: 0.2s; }
.auth-field:nth-child(3) { animation-delay: 0.3s; }
.auth-field:nth-child(4) { animation-delay: 0.4s; }
.auth-field:nth-child(5) { animation-delay: 0.5s; }
.auth-field:nth-child(6) { animation-delay: 0.6s; }

@media (max-width: 575.98px) {
  .auth-field { animation: none; }
}

.auth-field label {
  display: block;
  margin-bottom: .42rem;
  color: #563827;
  font: 700 .69rem Georgia,serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-control {
  position: relative;
}

.auth-control > i {
  position: absolute;
  top: 50%;
  left: .95rem;
  color: #9a6d39;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-control input,
.auth-control select,
.auth-control textarea {
  width: 100%;
  min-height: 52px;
  padding: .75rem 3rem .75rem 2.85rem;
  color: #493321;
  background: rgba(255,246,218,.62);
  border: 1px solid rgba(105,61,26,.38);
  border-radius: 2px 6px 3px 5px;
  outline: 0;
  font: .91rem Georgia,serif;
  transition: border-color .25s ease,box-shadow .25s ease,background .25s ease,transform .25s ease;
}

.auth-control input:focus,
.auth-control select:focus,
.auth-control textarea:focus {
  border-color: #c99b53;
  box-shadow: 0 0 0 3px rgba(201,155,83,.15), 0 4px 12px rgba(20,8,3,.15);
  background: rgba(255,250,232,.82);
  transform: translateY(-1px);
}

.auth-control input::placeholder,
.auth-control select::placeholder,
.auth-control textarea::placeholder {
  color: #a6876a;
  font-style: italic;
}

.auth-control select { cursor: pointer; }
.auth-control textarea {
  min-height: 112px;
  padding-top: .95rem;
  resize: vertical;
  line-height: 1.55;
}
.auth-control textarea::placeholder { color: #998268; }
.auth-control input::placeholder { color: #998268; }
.auth-control input:focus,
.auth-control select:focus,
.auth-control textarea:focus {
  background: rgba(255,249,229,.88);
  border-color: var(--manuscript-red);
  box-shadow: 0 0 0 3px rgba(116,47,37,.11);
}

.auth-control input[aria-invalid="true"],
.auth-control select[aria-invalid="true"],
.auth-control textarea[aria-invalid="true"] {
  border-color: #a22f29;
  box-shadow: 0 0 0 3px rgba(162,47,41,.09);
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: .55rem;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #795331;
  background: transparent;
  border: 0;
  transform: translateY(-50%);
  transition: color .25s ease, transform .25s ease;
}

.auth-password-toggle:hover { 
  color: var(--manuscript-red); 
  transform: scale(1.1);
}

/* Floating labels */
.auth-control.floating-label {
  position: relative;
}
.auth-control.floating-label input,
.auth-control.floating-label textarea {
  padding: .85rem 3rem .85rem 2.85rem;
}
.auth-control.floating-label .label-text {
  position: absolute;
  left: 2.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #998268;
  font: .88rem Georgia,serif;
  pointer-events: none;
  transition: all .3s cubic-bezier(.22, 1, .36, 1);
  background: transparent;
}
.auth-control.floating-label input:focus + .label-text,
.auth-control.floating-label input:not(:placeholder-shown) + .label-text,
.auth-control.floating-label textarea:focus + .label-text,
.auth-control.floating-label textarea:not(:placeholder-shown) + .label-text {
  top: -10px;
  left: 1rem;
  font-size: .7rem;
  color: var(--manuscript-red);
  background: linear-gradient(135deg, rgba(255,249,229,.98), rgba(255,246,218,.95));
  padding: 0 .5rem;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(20,8,3,.08);
}
.auth-control.floating-label textarea + .label-text {
  top: 1rem;
  transform: none;
}
.auth-control.floating-label textarea:focus + .label-text,
.auth-control.floating-label textarea:not(:placeholder-shown) + .label-text {
  top: -8px;
  transform: translateY(-50%);
}

/* File upload styling */
.auth-file-upload {
  position: relative;
  min-height: 56px;
  border: 2px dashed rgba(105,61,26,.38);
  border-radius: var(--r-md);
  background: rgba(255,246,218,.62);
  cursor: pointer;
  transition: all .3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}
.auth-file-upload:hover {
  border-color: var(--manuscript-red);
  background: rgba(255,249,229,.88);
}
.auth-file-upload i {
  color: #9a6d39;
  font-size: 1.2rem;
}
.auth-file-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-label {
  color: #61462f;
  font: .88rem Georgia,serif;
  font-weight: 600;
}
.file-name {
  color: #795331;
  font: .82rem Georgia,serif;
  font-style: italic;
}
.auth-field-hint {
  margin: .4rem 0 0;
  color: #8d6736;
  font: .72rem/1.4 Georgia,serif;
  font-style: italic;
}

.auth-submit {
  transition: all .3s ease;
}
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(116,47,37,.3);
}

.auth-field-error {
  min-height: 1rem;
  margin: .3rem 0 0;
  color: #9c2f29;
  font: .7rem/1.4 Georgia,serif;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font: .78rem Georgia,serif;
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: .55rem;
  color: #61462f;
  cursor: pointer;
}
.auth-check input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--manuscript-red);
}
.auth-check a,
.auth-text-link,
.auth-switch a {
  color: var(--manuscript-red);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(116,47,37,.3);
  text-underline-offset: .18em;
}
.auth-check a:hover,
.auth-text-link:hover,
.auth-switch a:hover { text-decoration-color: currentColor; }

.auth-submit {
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: .15rem;
  transition: transform .3s ease, box-shadow .3s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74,20,43,.35);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-social {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .75rem;
}

.auth-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 46px;
  color: #5a3e28;
  background: rgba(255,246,218,.46);
  border: 1px solid rgba(105,61,26,.34);
  border-radius: 2px 6px 3px 5px;
  font: 700 .73rem Georgia,serif;
  transition: transform .25s ease,border-color .25s ease,background .25s ease;
}
.auth-social-btn:hover {
  color: var(--manuscript-red);
  background: rgba(255,249,229,.8);
  border-color: rgba(116,47,37,.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20,8,3,.12);
}

.auth-switch {
  margin: 1.25rem 0 0;
  color: #674d36;
  font: .83rem Georgia,serif;
  text-align: center;
}

.auth-status {
  display: none;
  margin: .15rem 0 0;
  padding: .8rem 1rem;
  border: 1px solid;
  border-radius: 2px 6px 3px 5px;
  font: .78rem/1.5 Georgia,serif;
}
.auth-status.is-visible { display: block; }
.auth-status.is-error { color: #8e2924; background: rgba(162,47,41,.08); border-color: rgba(162,47,41,.28); }
.auth-status.is-success { color: #315e3d; background: rgba(54,107,68,.09); border-color: rgba(54,107,68,.3); }
.auth-status i { margin-right: .4rem; }

.password-strength {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: .3rem;
  margin-top: .45rem;
}
.password-strength span {
  height: 3px;
  background: rgba(99,62,31,.16);
  border-radius: 2px;
}
.password-strength[data-level="1"] span:nth-child(-n+1) { background: #a83a31; }
.password-strength[data-level="2"] span:nth-child(-n+2) { background: #b5782f; }
.password-strength[data-level="3"] span:nth-child(-n+3) { background: #6b843e; }
.password-strength[data-level="4"] span { background: #356846; }
.password-strength-text {
  margin: .28rem 0 0;
  color: #806448;
  font: .68rem Georgia,serif;
}

@media (max-width: 991.98px) {
  .auth-layout { 
    grid-template-columns: 1fr; 
    width: min(720px,calc(100% - 2rem)); 
    animation: slideUpCard 0.8s ease-out;
  }
  .auth-story { 
    min-height: 430px; 
    border-radius: 3px 11px 0 0; 
    padding: clamp(2rem,4vw,3rem);
  }
  .auth-story-copy h1 { max-width: 13ch; }
  .auth-sheet { 
    border-radius: 0 0 4px 9px;
    animation: fadeInSheet 1s ease-out 0.2s both;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .auth-layout {
    width: min(680px,calc(100% - 2rem));
  }
  .auth-story {
    min-height: 400px;
    padding: 2.5rem 2rem;
  }
  .auth-sheet {
    padding: 2.5rem 2rem;
  }
  .auth-control input,
  .auth-control select,
  .auth-control textarea {
    font-size: .9rem;
  }
}

@media (max-width: 575.98px) {
  .auth-stage { padding: 1.4rem 0 2.5rem; }
  .auth-stage::after { inset: 8px; }
  .auth-layout { width: calc(100% - 1.2rem); }
  .auth-story { 
    min-height: 350px; 
    padding: 2rem 1.5rem;
    border-radius: 3px 11px 0 0;
  }
  .auth-story-copy h1 { font-size: 2.55rem; }
  .auth-story-copy > p { font-size: .9rem; }
  .auth-promises { display: none; }
  .auth-quote { margin-top: 1.2rem; }
  .auth-sheet { 
    padding: 2.3rem 1.3rem;
    border-radius: 0 0 4px 9px;
  }
  .auth-sheet::before { inset: 8px; }
  .auth-grid-2,
  .auth-social { grid-template-columns: 1fr; }
  .auth-options { align-items: flex-start; flex-direction: column; gap: .7rem; }
  .auth-control input,
  .auth-control select,
  .auth-control textarea {
    padding: .75rem 2.5rem .75rem 2.5rem;
    font-size: .85rem;
  }
  .auth-control > i {
    left: .85rem;
    font-size: .85rem;
  }
  .auth-password-toggle {
    width: 34px;
    height: 34px;
    right: .45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-control input,
  .auth-control select,
  .auth-social-btn,
  .auth-password-toggle { transition: none !important; }
  .auth-stage,
  .auth-layout,
  .auth-sheet,
  .auth-story-image {
    animation: none !important;
  }
}

/* Enhanced focus states for accessibility */
.auth-control input:focus-visible,
.auth-control select:focus-visible,
.auth-control textarea:focus-visible {
  outline: 2px solid var(--manuscript-red);
  outline-offset: 2px;
}

/* Add subtle hover effect to story section */
.auth-story {
  transition: filter 0.3s ease;
}

.auth-story:hover {
  filter: brightness(1.02);
}

/* Button loading state */
.auth-submit.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.auth-submit.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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