/* =====================================================
   APNA DATA — LOGIN / LANDING SCREEN
   -----------------------------------------------------
   The login card stays visually independent from the
   information frame. Authentication markup/IDs are kept
   unchanged so existing login JavaScript continues to work.
===================================================== */

.login {
  min-height: 100vh;
  position: relative;
  z-index: 100;
  padding: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 10%, rgba(38,116,255,.26), transparent 30%),
    radial-gradient(circle at 92% 20%, rgba(0,197,170,.18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(73,92,255,.16), transparent 34%),
    linear-gradient(135deg, #071426 0%, #0b1d38 48%, #06111f 100%);
}

.login::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 45%, rgba(255,255,255,.025) 45.5%, transparent 46%),
    linear-gradient(300deg, transparent 0 70%, rgba(255,255,255,.02) 70.5%, transparent 71%);
}

.login-layout {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  align-items: stretch;
  gap: 28px;
  height: calc(100vh - 68px);
  position: relative;
  z-index: 1;
}

/* =====================================================
   STATIC LOGIN WINDOW
===================================================== */

.loginbox {
  position: sticky;
  top: 0;
  align-self: start;
  height: fit-content;
  max-height: calc(100vh - 68px);
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(255,255,255,.985), rgba(245,249,255,.98));
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 30px 90px rgba(0,0,0,.34), 0 0 0 1px rgba(69,126,218,.12);
}

.login-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .5px;
  background: linear-gradient(135deg, #2563eb, #00a88f);
  box-shadow: 0 12px 26px rgba(37,99,235,.26);
}

.login-brand-provider {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 18px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0f6f67;
  background: rgba(14,159,131,.10);
  border: 1px solid rgba(14,159,131,.16);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
}

.login-brand-kicker,
.info-frame-eyebrow,
.card-label {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.login-brand-kicker {
  color: #64748b;
  margin-bottom: 6px;
}

.loginbox h1 {
  margin: 0;
  color: #102a50;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -.8px;
}

.login-tagline {
  margin: 7px 0 12px;
  color: #1769e8;
  font-size: 15px;
  font-weight: 800;
}

.login-intro {
  margin: 0 0 24px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.login-form {
  display: block;
}

.login-field-label {
  display: block;
  margin: 13px 0 7px;
  color: #1e3558;
  font-size: 12px;
  font-weight: 800;
}

.password-field-wrap {
  position: relative;
  width: 100%;
}

.password-field-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(37,99,235,.08);
  color: #2563eb;
}

.password-eye-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle.is-visible .password-eye-icon {
  color: #2563eb;
}

.loginbox input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 15px;
  margin: 0;
  border: 1px solid #d7e0ed;
  border-radius: 13px;
  background: #fff;
  color: #102a50;
  font: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.loginbox input::placeholder {
  color: #94a3b8;
}

.loginbox input:focus {
  border-color: #2874eb;
  box-shadow: 0 0 0 4px rgba(40,116,235,.12);
}

.loginbox #loginBtn {
  margin-top: 20px;
  min-height: 49px;
  border: 0;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0b86d9);
  box-shadow: 0 12px 28px rgba(37,99,235,.27);
}

.loginbox #loginBtn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.loginbox #loginMsg {
  min-height: 18px;
  margin: 12px 0 0;
  color: #64748b;
  font-size: 12px;
}

.login-security-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5ebf3;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.login-security-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: #0e9f83;
}

/* =====================================================
   SEPARATE INFORMATION FRAME
===================================================== */

.login-info-frame {
  min-width: 0;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 30px;
  border: 1px solid rgba(148,187,236,.20);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15,35,65,.88), rgba(7,22,42,.78));
  box-shadow: 0 30px 90px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-info-frame::-webkit-scrollbar { width: 8px; }
.login-info-frame::-webkit-scrollbar-track { background: rgba(255,255,255,.035); border-radius: 10px; }
.login-info-frame::-webkit-scrollbar-thumb { background: rgba(126,168,213,.38); border-radius: 10px; }
.login-info-frame::-webkit-scrollbar-thumb:hover { background: rgba(126,168,213,.58); }

.info-frame-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.info-frame-eyebrow {
  color: #5fd6c0;
  margin-bottom: 8px;
}

.info-frame-header h2 {
  margin: 0;
  color: #fff;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.4px;
}

.info-frame-header p {
  max-width: 650px;
  margin: 8px 0 0;
  color: #aebfd5;
  font-size: 13px;
  line-height: 1.6;
}

.info-frame-badge {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(92,215,195,.24);
  border-radius: 13px;
  color: #7be2cf;
  font-size: 12px;
  font-weight: 900;
  background: rgba(27,167,142,.10);
}

.login-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.login-info-card,
.login-ai-info,
.login-company-info {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(160,195,232,.16);
  background: rgba(255,255,255,.045);
}

.login-info-card {
  min-height: 285px;
  padding: 20px;
}

.login-info-card::after,
.login-ai-info::after,
.login-company-info::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -55px;
  bottom: -65px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}

.goals-card { background: linear-gradient(145deg, rgba(7,121,105,.28), rgba(8,44,57,.36)); }
.expenses-card { background: linear-gradient(145deg, rgba(190,102,40,.25), rgba(66,36,31,.38)); }
.tasks-card { background: linear-gradient(145deg, rgba(65,75,190,.28), rgba(28,29,75,.40)); }

.card-clipart {
  width: 86px;
  height: 72px;
  margin-bottom: 18px;
}

.card-clipart svg,
.ai-clipart svg,
.company-clipart svg {
  width: 100%;
  height: 100%;
}

.clip-bg { fill: rgba(54,205,177,.18); stroke: rgba(91,227,203,.32); stroke-width: 2; }
.clip-mid { fill: rgba(54,205,177,.26); stroke: #55d9c0; stroke-width: 2; }
.clip-front { fill: #5ce0c5; }
.clip-line { fill: none; stroke: rgba(214,245,240,.75); stroke-width: 4; stroke-linecap: round; }
.clip-arrow { fill: none; stroke: #75e8d2; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.clip-wallet { fill: rgba(255,180,104,.18); stroke: #f3a261; stroke-width: 3; }
.clip-wallet-tab { fill: rgba(255,190,115,.24); stroke: #f4a96b; stroke-width: 3; }
.clip-dot { fill: #ffd09d; }
.clip-chart { fill: none; stroke: #ffc27f; stroke-width: 5; stroke-linecap: round; }
.clip-board { fill: rgba(127,140,255,.20); stroke: #9ca8ff; stroke-width: 3; }
.clip-tab { fill: #9ca8ff; }
.clip-check { fill: none; stroke: #aeb8ff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

.card-label {
  margin-bottom: 8px;
  color: #7fe2d0;
}

.expenses-card .card-label { color: #ffc58f; }
.tasks-card .card-label { color: #aab5ff; }

.login-info-card h3,
.login-ai-info h3,
.login-company-info h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 17px;
  line-height: 1.3;
}

.login-info-card p,
.login-ai-info p,
.login-company-info p {
  margin: 0;
  color: #b5c5d8;
  font-size: 12px;
  line-height: 1.65;
}

/* AI card */
.login-ai-info {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 21px;
  background: linear-gradient(135deg, rgba(24,104,196,.25), rgba(11,80,101,.25));
}

.ai-clipart {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(39,134,226,.13);
  border: 1px solid rgba(93,183,255,.18);
}

.robot-body { fill: rgba(119,202,255,.18); stroke: #75c9ff; stroke-width: 3; }
.robot-eye { fill: #9ce4ff; }
.robot-line { fill: none; stroke: #83d7ff; stroke-width: 3; stroke-linecap: round; }
.robot-bar { fill: rgba(64,180,244,.24); stroke: #57b8f5; stroke-width: 2; }

.ai-pill {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, #1976ed, #08a6a0);
  box-shadow: 0 10px 22px rgba(25,118,237,.25);
}

/* Shishtech card */
.login-company-info {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 21px;
  background: linear-gradient(135deg, rgba(11,151,132,.17), rgba(24,73,101,.22));
}

.company-clipart {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(37,188,159,.09);
  border: 1px solid rgba(80,218,190,.16);
}

.building-main { fill: rgba(71,204,176,.16); stroke: #63d8c2; stroke-width: 3; stroke-linejoin: round; }
.building-window { fill: #75d9ff; opacity: .78; }
.building-door { fill: #8be3d1; }

/* Policy */
.login-policy {
  margin-top: 18px;
  padding: 18px 4px 2px;
  border-top: 1px solid rgba(166,193,221,.14);
}

.policy-title {
  margin-bottom: 6px;
  color: #d9e7f6;
  font-size: 12px;
  font-weight: 800;
}

.login-policy p {
  margin: 0;
  color: #8499b1;
  font-size: 10.5px;
  line-height: 1.65;
}

.policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: #9fb2c9;
  font-size: 10px;
}

.policy-links i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #4c6683;
}

.login-footer-brand {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(166,193,221,.10);
  color: #d7e6f5;
  font-size: 11px;
}

.login-footer-brand b {
  color: #7088a4;
  font-weight: 600;
}

/* =====================================================
   SINGLE LOGIN CONFIRMATION MODAL
===================================================== */

.single-login-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3,12,24,.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.single-login-modal.show {
  display: flex;
  animation: singleLoginFade .18s ease-out;
}

.single-login-card {
  width: min(470px, 100%);
  background: #fff;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
  text-align: center;
  animation: singleLoginCardIn .2s ease-out;
}

.single-login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 30px;
}

.single-login-card h3 {
  margin: 0 0 12px;
  color: #14284b;
  font-size: 22px;
  font-weight: 800;
}

.single-login-card p {
  margin: 0 auto;
  max-width: 390px;
  color: #475569;
  line-height: 1.6;
  font-size: 15px;
}

.single-login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 26px;
}

.single-login-actions button {
  min-height: 46px;
  border-radius: 11px;
  border: 0;
  font-size: 15px;
  font-weight: 800;
}

#singleLoginNo { background: #dc2626; color: #fff; }
#singleLoginYes { background: #2563eb; color: #fff; }
#singleLoginNo:hover,
#singleLoginYes:hover { filter: brightness(.95); }

body.single-login-open { overflow: hidden; }

@keyframes singleLoginFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes singleLoginCardIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@font-face {
  font-family: "Arial Black Custom";
  src: url("../fonts/ariblk.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1040px) {
  .login-layout {
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    gap: 20px;
  }

  .loginbox { padding: 28px; }
  .login-info-frame { padding: 24px; }
  .login-info-grid { grid-template-columns: 1fr; }
  .login-info-card { min-height: auto; }
}

@media (max-width: 820px) {
  .login {
    padding: 18px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .login-layout {
    grid-template-columns: 1fr;
    max-width: 680px;
    height: auto;
  }

  .loginbox {
    position: relative;
    top: auto;
    max-height: none;
  }

  .login-info-frame {
    padding: 20px;
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .login { padding: 12px; }
  .loginbox { padding: 24px 20px; border-radius: 22px; }
  .loginbox h1 { font-size: 30px; }
  .login-info-frame { padding: 17px; border-radius: 22px; }
  .info-frame-header { flex-direction: column; }
  .info-frame-header h2 { font-size: 23px; }
  .login-ai-info,
  .login-company-info { grid-template-columns: 1fr; }
  .ai-pill { display: none; }
  .login-footer-brand { flex-direction: column; }
  .single-login-card { padding: 24px 20px; }
  .single-login-actions { grid-template-columns: 1fr; }
}

/* Prevent the login screen from flashing while Supabase session state is restored. */
body.auth-pending #login,
body.auth-pending #app {
  visibility: hidden !important;
}

body.auth-pending { overflow: hidden; }
