/* =========================================================
   DayFlow Auth Page
   Split-panel login / create account layout
   Main editable sections:
   1. Overlay and shell layout
   2. Brand panel
   3. Form panel
   4. Mobile responsive rules
   ========================================================= */

/* 1. Overlay and shell layout */

html.auth-open,
body.auth-open{
  height:auto !important;
  min-height:100% !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  overscroll-behavior:auto !important;
}

body.auth-open #app{
  display:none !important;
}

#auth-overlay{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  background:
    radial-gradient(circle at 15% 20%, rgba(125,178,255,.16) 0%, rgba(125,178,255,0) 30%),
    radial-gradient(circle at 85% 15%, rgba(105,213,160,.12) 0%, rgba(105,213,160,0) 28%),
    linear-gradient(180deg, #081019 0%, #0d1420 46%, #09101a 100%);
}

#auth-overlay.hidden{
  display:none;
}

.auth-shell{
  width:min(1120px, 100%);
  min-height:min(720px, calc(100vh - 64px));
  display:grid;
  grid-template-columns:minmax(320px, 1.1fr) minmax(360px, .9fr);
  gap:24px;
  align-items:stretch;
}

.auth-panel{
  position:relative;
  border:1px solid rgba(125, 178, 255, 0.14);
  border-radius:32px;
  background:linear-gradient(180deg, rgba(18,27,41,.88) 0%, rgba(14,22,34,.95) 100%);
  box-shadow:0 24px 70px rgba(0,0,0,.38);
  overflow:hidden;
}

/* 2. Brand panel */
.auth-panel--brand{
  padding:40px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.auth-panel--brand::before{
  content:"";
  position:absolute;
  inset:auto -12% -18% auto;
  width:340px;
  height:340px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(105,213,160,.22) 0%, rgba(105,213,160,0) 68%);
  pointer-events:none;
}

.auth-panel--brand::after{
  content:"";
  position:absolute;
  inset:-12% auto auto -10%;
  width:280px;
  height:280px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(125,178,255,.18) 0%, rgba(125,178,255,0) 70%);
  pointer-events:none;
}

.auth-brand-badge{
  position:relative;
  z-index:1;
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:fit-content;
  padding:10px 14px;
  border:1px solid rgba(125,178,255,.18);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  color:var(--text);
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
}

.auth-hero-title{
  position:relative;
  z-index:1;
  margin:22px 0 12px;
  max-width:560px;
  font-size:clamp(34px, 4.2vw, 52px);
  line-height:1.02;
  letter-spacing:-.05em;
  color:var(--text);
}

.auth-hero-copy{
  position:relative;
  z-index:1;
  max-width:560px;
  margin:0 0 28px;
  color:var(--text2);
  font-size:18px;
  line-height:1.65;
}

.auth-highlight-grid{
  position:relative;
  z-index:1;
  display:grid;
  gap:14px;
  grid-template-columns:1fr;
}

.auth-highlight-card{
  padding:18px 18px 17px;
  border:1px solid rgba(125,178,255,.12);
  border-radius:22px;
  background:rgba(255,255,255,.03);
  backdrop-filter:blur(10px);
}

.auth-highlight-title{
  margin-bottom:6px;
  color:var(--text);
  font-size:18px;
  font-weight:700;
}

.auth-highlight-copy{
  color:var(--text2);
  font-size:15px;
  line-height:1.6;
}

.auth-meta-row{
  position:relative;
  z-index:1;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:28px;
}

.auth-meta-pill{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(125,178,255,.16);
  background:rgba(9,16,26,.55);
  color:var(--text2);
  padding:12px 14px !important;
  font-size:13px;
  line-height:1.3;
  text-align:center;
  font-weight:600;
}

/* 3. Form panel */
.auth-panel--form{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

.auth-card{
  width:min(100%, 460px) !important;
  margin:0 auto;
  padding:34px !important;
  border-radius:28px !important;
  background:linear-gradient(180deg, rgba(21,31,46,.96) 0%, rgba(16,24,37,.98) 100%) !important;
  border:1px solid rgba(125,178,255,.16) !important;
  box-shadow:0 20px 60px rgba(0,0,0,.32) !important;
}

.auth-kicker{
  margin-bottom:10px;
  color:var(--accent);
  font-size:12px;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.auth-title{
  font-size:38px !important;
  line-height:1.04;
  letter-spacing:-.05em;
  margin-bottom:10px !important;
}

.auth-sub{
  margin-bottom:22px !important;
  color:var(--text2) !important;
  font-size:15px !important;
  line-height:1.7 !important;
}


.auth-mode-label{
  margin:4px 0 10px;
  color:var(--text2);
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.auth-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  margin-bottom:18px !important;
  gap:10px;
}

.auth-tab{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:4px;
  min-height:88px;
  border:1px solid rgba(125,178,255,.14) !important;
  border-radius:18px !important;
  background:rgba(255,255,255,.02) !important;
  color:var(--text2) !important;
  padding:16px 16px !important;
  text-align:left;
  font-weight:700;
  box-shadow:none !important;
  transition:background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.auth-tab-title{
  display:block;
  color:var(--text);
  font-size:16px;
  font-weight:800;
  line-height:1.2;
}

.auth-tab-copy{
  display:block;
  color:var(--text2);
  font-size:13px;
  font-weight:600;
  line-height:1.45;
}

#auth-overlay .auth-tab.active{
  background:linear-gradient(180deg, rgba(83,112,214,.20) 0%, rgba(70,93,182,.14) 100%) !important;
  border-color:rgba(124,158,255,.52) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 12px 24px rgba(53,73,146,.14) !important;
}

#auth-overlay .auth-tab.active .auth-tab-title{
  color:#eef3ff !important;
}

#auth-overlay .auth-tab.active .auth-tab-copy{
  color:#d5def4 !important;
}

.auth-tab:hover{
  transform:translateY(-1px);
  border-color:rgba(125,178,255,.24) !important;
}


.auth-field{
  margin-bottom:14px !important;
}

.auth-label{
  margin-bottom:8px !important;
}

.auth-input{
  min-height:52px;
  border-radius:16px !important;
  padding:15px 16px !important;
  background:rgba(9,16,26,.68) !important;
}

.auth-input:focus{
  border-color:rgba(125,178,255,.42) !important;
  box-shadow:0 0 0 4px rgba(125,178,255,.10);
}

.auth-actions{
  margin-top:18px !important;
}

.auth-btn{
  min-height:52px;
  border-radius:16px !important;
  padding:14px 18px !important;
}

.auth-secondary{
  background:rgba(255,255,255,.04) !important;
}

.auth-status,
.auth-error{
  margin-top:12px !important;
}

/* 4. Mobile responsive rules */
@media (max-width: 980px){
  body.auth-open #auth-overlay{
    position:relative;
    inset:auto;
    min-height:100dvh;
    align-items:flex-start;
    justify-content:stretch;
    padding:20px 16px 28px;
  }

  #auth-overlay{
    padding:20px;
  }

  .auth-shell{
    grid-template-columns:1fr;
    min-height:auto;
  }

  .auth-panel--brand{
    order:2;
    padding:28px;
  }

  .auth-panel--form{
    order:1;
  }

  .auth-hero-title{
    max-width:none;
    font-size:clamp(30px, 7vw, 42px);
  }

  .auth-hero-copy{
    max-width:none;
    font-size:16px;
  }
}

@media (max-width: 640px){
  body.auth-open #auth-overlay{
    padding:14px 14px 22px;
  }

  #auth-overlay{
    padding:14px;
    align-items:stretch;
  }

  .auth-shell{
    gap:14px;
  }

  .auth-panel,
  .auth-card{
    border-radius:24px !important;
  }

  .auth-panel--brand,
  .auth-panel--form{
    padding:20px;
  }

  .auth-card{
    padding:24px !important;
  }

  .auth-title{
    font-size:32px !important;
  }

  .auth-tabs{
    grid-template-columns:1fr;
  }

  .auth-actions{
    flex-direction:column;
  }

  .auth-btn{
    width:100%;
  }
}


/* Auth tabs: keep distinct from the main green submit button */
#auth-overlay .auth-tabs .auth-tab{
  background:rgba(255,255,255,.02) !important;
  color:var(--text2) !important;
}

#auth-overlay .auth-tabs .auth-tab.active{
  background:linear-gradient(180deg, rgba(99,132,255,.18) 0%, rgba(86,118,232,.14) 100%) !important;
  border-color:rgba(124,158,255,.42) !important;
  color:var(--text) !important;
}

#auth-overlay .auth-btn.auth-secondary{
  background:rgba(255,255,255,.04) !important;
  color:var(--text) !important;
}


/* v4 hardening: avoid cache confusion and force mobile auth scrolling */
@media (max-width: 980px){
  html.auth-open, body.auth-open{
    height:100% !important;
    min-height:100dvh !important;
    overflow:auto !important;
  }
  #auth-overlay{
    position:fixed !important;
    inset:0 !important;
    height:100dvh !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }
  .auth-shell{
    min-height:max-content !important;
    height:auto !important;
    padding-bottom:16px;
  }
}
@media (max-width: 640px){
  #auth-overlay{
    padding:14px 14px 28px !important;
  }
  .auth-shell{
    width:100% !important;
  }
}
/* Final tab colours: distinct from primary CTA no matter the user accent */
#auth-overlay .auth-tabs .auth-tab{
  background:rgba(255,255,255,.035) !important;
  color:#c1cad9 !important;
  border-color:rgba(124,158,255,.18) !important;
}
#auth-overlay .auth-tabs .auth-tab.active{
  background:linear-gradient(180deg, rgba(83,112,214,.28) 0%, rgba(70,93,182,.22) 100%) !important;
  color:#eef3ff !important;
  border-color:rgba(124,158,255,.52) !important;
}
