/* ═══════════════════════════════════════════════════════════════
   T-RAYO ATELIER AUTHENTICATION SYSTEM (Sign Up & Sign In)
   Aesthetic: Luxury Obsidian Noir & Platinum Atelier Palette
   Accents: Refined Champagne Gold (#d4af37) & High-Contrast White
   100% Fully Responsive across Mobile (320px+), Tablet, and Desktop
═══════════════════════════════════════════════════════════════ */

:root {
  --auth-bg: #07080c;
  --auth-card-bg-start: #11131b;
  --auth-card-bg-mid: #0b0c12;
  --auth-card-bg-end: #07080c;
  --auth-card-border: rgba(255, 255, 255, 0.08);
  --auth-gold: #d4af37;
  --auth-gold-light: #f3e5ab;
  --auth-gold-glow: rgba(212, 175, 55, 0.16);
  --auth-emerald: #10b981;
  --auth-text-white: #ffffff;
  --auth-text-silver: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-text-dim: #64748b;
  --auth-input-bg: #0d0f16;
  --auth-input-border: #1e2230;
  --auth-input-focus-border: #d4af37;
  --auth-radius-card: 18px;
  --auth-radius-input: 8px;
  --auth-radius-btn: 9999px;
  --auth-transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--auth-bg);
  background-image: 
    radial-gradient(circle at 50% 12%, rgba(212, 175, 55, 0.07) 0%, rgba(7, 8, 12, 0) 55%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.04) 0%, transparent 45%),
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--auth-text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.75rem, 2.5vw, 1.25rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Ambient subtle lighting */
.auth-ambient-glow {
  position: fixed;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  max-width: 90vw;
  height: 480px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* Page wrapper container */
.auth-page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN AUTH CARD (Obsidian Noir Atelier Edition)
═══════════════════════════════════════════════════════════════ */
.auth-card {
  width: 100%;
  background: linear-gradient(175deg, var(--auth-card-bg-start) 0%, var(--auth-card-bg-mid) 50%, var(--auth-card-bg-end) 100%);
  border: 1px solid var(--auth-card-border);
  border-radius: var(--auth-radius-card);
  padding: clamp(1.6rem, 4vw, 2.3rem) clamp(1rem, 3.5vw, 2rem) clamp(1.4rem, 3.5vw, 1.85rem);
  position: relative;
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.85),
    0 0 1px 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardPopIn 300ms cubic-bezier(.16, 1, .3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@keyframes cardPopIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Top Back & Close Buttons */
.auth-back-btn,
.auth-close-btn {
  position: absolute;
  top: 1.15rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--auth-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: var(--auth-transition);
  z-index: 10;
  padding: 0;
  text-decoration: none;
}

.auth-back-btn {
  left: 1.15rem;
}

.auth-close-btn {
  right: 1.15rem;
  font-size: 1.1rem;
}

.auth-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateX(-2px);
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Brand Logo */
.auth-brand-logo {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #ffffff;
  text-align: center;
  margin-top: 0.1rem;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  display: block;
}

/* Segmented Tabs Navigation (Create Account / Sign In) */
.auth-tabs-nav {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9999px;
  padding: 3px;
  margin: 0 auto 1.15rem;
  width: 100%;
  max-width: 280px;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.42rem 0.65rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--auth-text-muted);
  font-size: clamp(0.72rem, 2vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--auth-transition);
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
}

.auth-tab-btn:hover {
  color: #ffffff;
}

.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Main Heading */
.auth-title {
  font-family: 'Syne', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.2rem, 3.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin-bottom: 0.35rem;
  line-height: 1.22;
  text-align: center;
  text-transform: uppercase;
  word-break: break-word;
}

/* Description Subtitle */
.auth-desc {
  font-size: clamp(0.76rem, 2vw, 0.84rem);
  color: var(--auth-text-muted);
  line-height: 1.45;
  text-align: center;
  margin: 0 auto 1.25rem;
  max-width: 330px;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════
   FORM & INPUTS (Sleek Obsidian & Subtle Gold Focus)
═══════════════════════════════════════════════════════════════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  text-align: left;
}

.auth-form-group label {
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.auth-form-group label .req-star {
  color: var(--auth-gold);
  font-weight: 700;
}

.auth-form-group label .label-opt {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--auth-text-dim);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* 2-Column Responsive Form Row */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 500px) {
  .auth-form-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* Input Box with Icon */
.auth-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--auth-text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 180ms ease;
  z-index: 2;
}

.auth-input-box:focus-within .auth-input-icon {
  color: var(--auth-gold);
}

.auth-input {
  width: 100%;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: var(--auth-radius-input);
  padding: 0.72rem 0.95rem 0.72rem 2.45rem;
  color: #ffffff;
  font-size: 15px; /* Prevents iOS auto-zoom while remaining sleek */
  font-family: inherit;
  min-height: 44px;
  transition: var(--auth-transition);
}

.auth-input::placeholder {
  color: #475569;
  font-weight: 400;
  font-size: 0.84rem;
}

.auth-input:focus {
  border-color: var(--auth-input-focus-border);
  background: #11131c;
  box-shadow: 0 0 0 3px var(--auth-gold-glow), inset 0 1px 2px rgba(0, 0, 0, 0.4);
  outline: none;
}

/* Password eye button */
.password-input-wrap .auth-input {
  padding-right: 2.65rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--auth-text-dim);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 150ms ease;
}

.password-toggle-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* Row for Forgot Password */
.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -0.2rem;
}

.forgot-link {
  color: var(--auth-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease;
  margin-left: auto;
}

.forgot-link:hover {
  color: var(--auth-gold);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   SUBMIT BUTTON (High-Contrast Platinum Luxury Atelier Button)
═══════════════════════════════════════════════════════════════ */
.auth-submit-btn {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 1rem;
  font-size: clamp(0.78rem, 2.2vw, 0.86rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--auth-radius-btn);
  background: #ffffff;
  color: #090a0f;
  border: 1px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12), 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: var(--auth-transition);
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  font-family: inherit;
}

.auth-btn-text {
  display: inline-block;
  line-height: 1.2;
}

.auth-submit-btn:hover {
  background: #f1f5f9;
  border-color: #f1f5f9;
  transform: translateY(-1.5px);
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.2);
}

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

.auth-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER LINKS & SWITCHER
═══════════════════════════════════════════════════════════════ */
.auth-footer-links {
  margin-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: center;
  text-align: center;
}

.switch-row {
  font-size: clamp(0.76rem, 2vw, 0.82rem);
  color: var(--auth-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-text-link {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 1px 2px;
  transition: all 150ms ease;
}

.auth-text-link:hover {
  color: var(--auth-gold);
  border-bottom-color: var(--auth-gold);
}

/* Trust SSL Guarantee Badge */
.auth-trust-badge {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--auth-text-dim);
  text-align: center;
  user-select: none;
}

.ssl-shield-icon {
  width: 13px;
  height: 13px;
  color: var(--auth-emerald);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATION (Clean Emerald / Ruby)
═══════════════════════════════════════════════════════════════ */
.auth-toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  max-width: 90vw;
  padding: 0.75rem 1.15rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 200ms ease;
  pointer-events: none;
}

.auth-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.auth-toast.success {
  background: #064e3b;
  border: 1px solid #059669;
  color: #a7f3d0;
}

.auth-toast.error {
  background: #4c0519;
  border: 1px solid #be123c;
  color: #fecdd3;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE MEDIA QUERIES
═══════════════════════════════════════════════════════════════ */

/* Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  body {
    padding: 0.75rem 0.5rem;
    align-items: center;
  }

  .auth-ambient-glow {
    width: 280px;
    height: 280px;
    top: 5%;
  }

  .auth-card {
    padding: 1.5rem 1.05rem 1.25rem;
    border-radius: 14px;
  }

  .auth-back-btn,
  .auth-close-btn {
    top: 0.85rem;
    width: 28px;
    height: 28px;
  }

  .auth-back-btn {
    left: 0.85rem;
  }

  .auth-close-btn {
    right: 0.85rem;
    font-size: 1rem;
  }

  .auth-back-btn svg {
    width: 14px;
    height: 14px;
  }

  .auth-brand-logo {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
  }

  .auth-tabs-nav {
    max-width: 240px;
    margin-bottom: 0.95rem;
  }

  .auth-title {
    font-size: clamp(1.1rem, 4.8vw, 1.35rem);
    margin-bottom: 0.3rem;
  }

  .auth-desc {
    font-size: 0.78rem;
    margin-bottom: 1.1rem;
  }

  .auth-form {
    gap: 0.75rem;
  }

  .auth-form-group label {
    font-size: 0.66rem;
  }

  .auth-input {
    min-height: 42px;
    padding: 0.65rem 0.85rem 0.65rem 2.3rem;
    font-size: 16px; /* Prevents auto zoom */
  }

  .auth-input-icon {
    left: 0.75rem;
  }

  .auth-submit-btn {
    min-height: 44px;
    padding: 0.72rem 0.85rem;
  }

  .auth-toast {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    font-size: 0.78rem;
  }
}

/* Very Small Phones (<= 360px) */
@media (max-width: 360px) {
  .auth-card {
    padding: 1.35rem 0.8rem 1.1rem;
  }

  .auth-tabs-nav {
    max-width: 210px;
    padding: 2px;
  }

  .auth-tab-btn {
    font-size: 0.68rem;
    padding: 0.35rem 0.45rem;
  }

  .auth-title {
    font-size: 1.05rem;
  }

  .auth-desc {
    font-size: 0.72rem;
  }

  .auth-submit-btn {
    min-height: 42px;
    font-size: 0.74rem;
  }

  .switch-row {
    font-size: 0.72rem;
  }

  .auth-trust-badge {
    font-size: 0.62rem;
  }
}
