/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6, p, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* ===== BODY ===== */
body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #0f1a3c, #050814);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: transparent;
  z-index: 1000;
  box-sizing: border-box;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar .user {
  white-space: nowrap;
}

/* ===== CARD CONTAINER ===== */
.auth-container {
  width: 100%;
  max-width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.auth-card {
  max-width: 420px;
  margin: auto;
  background: linear-gradient(180deg, #0e1633, #0a1024);
  border-radius: 18px;
  padding: 40px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.auth-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.auth-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

/* ===== SUBTITLE ===== */
.subtitle {
  color: #9bb0ff;
  font-size: 14px;
  margin-bottom: 30px;
}

/* ===== INPUT LABEL ===== */
.input-group {
  margin-bottom: 18px;
}

.input-group label {
  font-size: 13px;
  color: #b8c4ff;
  display: block;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  max-width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #1e2a55;
  background: #070d22;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.input-group input:focus {
  outline: none;
  border-color: #4da3ff;
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 24px;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== LINK ===== */
.link {
  color: #6db6ff;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ===== TOOLTIP ===== */
.has-tooltip {
  position: relative;
}

.has-tooltip .tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  padding: 10px 14px;
  font-size: 0.75rem;
  line-height: 1.4;
  border-radius: 8px;
  white-space: normal;
  max-width: 250px;
  word-wrap: break-word;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 1px solid rgba(111, 210, 255, 0.2);
  z-index: 1000;
}

/* ===== TOOLTIP ARROW ===== */
.has-tooltip .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

/* ===== HOVER ===== */
.has-tooltip:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* ===== TOOLTIP IN TOPBAR (appears below) ===== */
.topbar .has-tooltip .tooltip {
  bottom: auto;
  top: calc(100% + 12px);
}

.topbar .has-tooltip .tooltip::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #1e293b transparent;
}

.topbar .has-tooltip:hover .tooltip {
  transform: translateX(-50%) translateY(6px);
}

/* ===== PRIMARY BUTTON ===== */
.btn-primary {
  width: 100%;
  max-width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, #4da3ff, #6cc1ff);
  color: #050814;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(77,163,255,0.35);
}

/* ===== BACK BUTTON ===== */
.back-nav {
  margin-bottom: 10px;
  padding-top: 40px;
}

.topbar .btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(111, 210, 255, 0.1);
  border: 1px solid rgba(111, 210, 255, 0.2);
  color: #6fd2ff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar .btn-back:hover {
  background: #6fd2ff;
  color: #12183a;
  border-color: #6fd2ff;
  transform: translateX(-4px);
  box-shadow: 0 10px 25px rgba(95, 185, 255, 0.3);
}

/* ===== FOOTER ===== */
.footer-text {
  margin-top: 24px;
  font-size: 13px;
  text-align: center;
  color: #b8c4ff;
  max-width: 100%;
  word-wrap: break-word;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 768px) {
  .topbar {
    padding: 18px 30px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .auth-container {
    padding: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .auth-card {
    max-width: 100%;
    padding: 36px 28px;
    box-sizing: border-box;
  }

  .back-nav {
    padding-top: 30px;
  }

  .auth-card h1 {
    font-size: 26px;
  }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 600px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  body {
    align-items: flex-start;
    padding-top: 100px;
  }

  .topbar {
    position: fixed;
    top: 0;
    padding: 16px 20px;
    background: transparent;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .topbar .user {
    font-size: 13px;
  }

  .auth-container {
    padding: 12px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .auth-card {
    padding: 32px 24px;
    border-radius: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .auth-card h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 24px;
  }

  .input-group {
    margin-bottom: 16px;
  }

  .input-group input {
    padding: 13px;
    font-size: 15px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .auth-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .btn-primary {
    padding: 13px;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-back {
    padding: 9px 18px;
    font-size: 13px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .back-nav {
    padding-top: 20px;
    margin-bottom: 8px;
  }

  .footer-text {
    font-size: 12px;
    margin-top: 20px;
  }

  .has-tooltip .tooltip {
    font-size: 0.7rem;
    padding: 8px 12px;
    white-space: normal;
    max-width: calc(100vw - 40px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .has-tooltip:hover .tooltip {
    transform: translateX(-50%) translateY(-6px);
  }

  .has-tooltip .tooltip::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .topbar .has-tooltip:hover .tooltip {
    transform: translateX(-50%) translateY(6px);
  }

  .topbar .has-tooltip .tooltip::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 400px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .topbar {
    padding: 14px 16px;
    max-width: 100vw;
  }

  .auth-container {
    padding: 8px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .auth-card h1 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 12px;
  }

  .input-group label {
    font-size: 12px;
  }

  .input-group input {
    padding: 12px;
    font-size: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-primary {
    padding: 12px;
    font-size: 13px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-back {
    padding: 8px 16px;
    font-size: 12px;
    max-width: 100%;
    box-sizing: border-box;
  }
}
