/* =========================================================
   TrustOne Auth UI (Premium)
   - Glass card + soft shadow
   - Button polish (hover/active/disabled)
   - Inputs focus ring + error state
   - Shake + fade animation
   ========================================================= */

:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.78);
  --card-border: rgba(255,255,255,0.35);
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: rgba(17,24,39,0.10);

  --brand: #0f2a5f;
  --accent: #ff7a00;
  --accent-2: #ff9f3d;

  --danger: #ef4444;
  --success: #16a34a;

  --shadow: 0 18px 60px rgba(0,0,0,0.35);
  --shadow-soft: 0 12px 40px rgba(17,24,39,0.18);

  --radius: 18px;
  --radius-sm: 12px;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body.auth-page{
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 10%, rgba(255,122,0,0.18), transparent 60%),
              radial-gradient(900px 500px at 80% 20%, rgba(15,42,95,0.22), transparent 60%),
              linear-gradient(180deg, #070b14 0%, #0b1220 100%);
  overflow-x: hidden;
}

/* Background image layer (optional) */
.auth-bg{
  position: fixed;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.26;
  filter: saturate(0.9) contrast(1.05);
  transform: scale(1.02);
  z-index: 0;
}

/* Vignette overlay */
.auth-vignette{
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 600px at 50% 15%, rgba(255,255,255,0.06), transparent 55%),
    radial-gradient(900px 700px at 50% 65%, rgba(0,0,0,0.40), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.65));
  z-index: 1;
}

.auth-wrapper{
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-card{
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 26px 22px 18px;
  position: relative;
  overflow: hidden;
}

.auth-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(600px 220px at 30% 0%, rgba(255,122,0,0.22), transparent 60%),
    radial-gradient(520px 220px at 70% 0%, rgba(15,42,95,0.22), transparent 60%);
  opacity: 0.55;
  pointer-events:none;
  z-index: 0;
}

.auth-card > *{
  position: relative;
  z-index: 1;
}

/* Animations */
.fade-in{
  animation: fadeInUp 420ms ease-out both;
}
@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

.shake{
  animation: shake 360ms ease-in-out;
}
@keyframes shake{
  0%{ transform: translateX(0); }
  20%{ transform: translateX(-10px); }
  40%{ transform: translateX(10px); }
  60%{ transform: translateX(-6px); }
  80%{ transform: translateX(6px); }
  100%{ transform: translateX(0); }
}

/* Brand header */
.auth-brand{
  text-align: center;
  margin-bottom: 14px;
}
.auth-brand h1{
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--brand);
}
.auth-brand h1 span{
  color: var(--accent);
}
.auth-brand p{
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* Tabs */
.auth-tabs{
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(17,24,39,0.10);
  border-radius: 999px;
  padding: 6px;
  margin: 14px 0 14px;
}
.auth-tabs button{
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all 180ms ease;
}
.auth-tabs button.active{
  background: rgba(15,42,95,0.95);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.auth-tabs button:hover{
  transform: translateY(-1px);
}

/* Alerts */
.auth-alert{
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.22);
  color: #7f1d1d;
  margin: 10px 0 12px;
}
.auth-alert.success{
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(22,163,74,0.22);
  color: #14532d;
}

/* Social buttons */
.social-login{
  margin: 8px 0 8px;
}

.google-btn{
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(17,24,39,0.12);
  background: rgba(255,255,255,0.82);
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(17,24,39,0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.google-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(17,24,39,0.18);
  background: rgba(255,255,255,0.92);
}
.google-btn:active{
  transform: translateY(0);
}
.google-btn:disabled{
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}
.google-ic{
  width: 18px;
  height: 18px;
}

/* Divider */
.divider{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.divider::before,
.divider::after{
  content:"";
  flex: 1;
  height: 1px;
  background: rgba(17,24,39,0.12);
}
.divider span{
  transform: translateY(-1px);
}

/* Fields */
.field{
  margin: 12px 0;
}
.label{
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.auth-input{
  width: 100%;
  border-radius: 14px;
  padding: 12px 12px;
  border: 1px solid rgba(17,24,39,0.14);
  background: rgba(255,255,255,0.92);
  outline: none;
  font-size: 13px;
  color: #111827;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.auth-input:focus{
  border-color: rgba(255,122,0,0.55);
  box-shadow: 0 0 0 4px rgba(255,122,0,0.18);
}
.auth-input.is-invalid{
  border-color: rgba(239,68,68,0.55);
  box-shadow: 0 0 0 4px rgba(239,68,68,0.14);
}

.field-error{
  margin-top: 6px;
  font-size: 12px;
  color: #991b1b;
  font-weight: 600;
}

/* Password input with toggle */
.password-wrap{
  position: relative;
}
.password-wrap .auth-input{
  padding-right: 44px;
}
.pw-toggle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: rgba(17,24,39,0.70);
  transition: background 160ms ease, transform 160ms ease;
}
.pw-toggle:hover{
  background: rgba(17,24,39,0.06);
  transform: translateY(-50%) scale(1.02);
}
.pw-toggle:active{
  transform: translateY(-50%) scale(0.98);
}
.pw-toggle svg{
  width: 18px;
  height: 18px;
}

/* Row: remember + forgot */
.auth-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}
.remember{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  font-weight: 600;
}
.remember input{
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.forgot{
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
}
.forgot:hover{
  text-decoration: underline;
}

/* Primary button */
.auth-btn{
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 16px 34px rgba(255,122,0,0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.auth-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(255,122,0,0.34);
  filter: saturate(1.05);
}
.auth-btn:active{
  transform: translateY(0);
}
.auth-btn:disabled{
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
.auth-footer{
  margin-top: 14px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(17,24,39,0.55);
}

/* Small screens */
@media (max-width: 420px){
  .auth-card{
    padding: 22px 16px 16px;
    border-radius: 16px;
  }
  .auth-brand h1{ font-size: 26px; }
}
