* {
  box-sizing: border-box;
}

:root {
  --bg: #090b0e;
  --sidebar: #101318;
  --sidebar-hover: #171b21;
  --panel: #111419;
  --panel-soft: #171b21;
  --border: rgba(255, 255, 255, 0.07);

  --text: #f4f6f8;
  --text-secondary: #a4acb8;
  --text-muted: #6e7682;

  --accent: #6d7cff;
  --accent-hover: #7d8aff;
  --accent-soft: rgba(109, 124, 255, 0.12);

  --success: #4fd18b;
  --danger: #ff6f7d;

  --bubble: #1b2027;
  --bubble-mine: #5968e9;

  --sidebar-width: 320px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}


/* =========================================================
   APP
========================================================= */

.app {
  width: 100%;
  height: 100dvh;
  display: flex;
  overflow: hidden;
  background: var(--bg);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  display: flex;
  flex-direction: column;

  background:
    linear-gradient(
      180deg,
      #111419 0%,
      #0f1216 100%
    );

  border-right: 1px solid var(--border);
  padding: 18px 14px 14px;

  position: relative;
  z-index: 20;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 2px 6px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 11px;

  color: #fff;

  background:
    linear-gradient(
      145deg,
      #7180ff,
      #5664dc
    );

  box-shadow:
    0 8px 24px rgba(82, 97, 220, 0.24);
}

.brand-icon svg {
  width: 21px;
  height: 21px;
}

.brand-name {
  font-size: 15px;
  line-height: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 500;
}

.icon-button {
  width: 36px;
  height: 36px;

  padding: 0;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 9px;

  color: var(--text-muted);
  background: transparent;

  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button:hover {
  color: var(--text);
  background: var(--sidebar-hover);
}

.icon-button:active {
  transform: scale(0.95);
}

.mobile-close {
  display: none;
}


/* =========================================================
   PROFILE
========================================================= */

.profile-card {
  display: flex;
  align-items: center;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: rgba(255, 255, 255, 0.025);

  margin-bottom: 12px;
}

.avatar {
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  border-radius: 50%;

  font-weight: 700;
  text-transform: uppercase;

  user-select: none;
}

.avatar-accent {
  width: 40px;
  height: 40px;

  color: white;

  background:
    linear-gradient(
      145deg,
      #7582ff,
      #515fd3
    );

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.12);
}

.profile-info {
  min-width: 0;
  flex: 1;

  margin-left: 11px;
}

.profile-name {
  overflow: hidden;

  color: var(--text);

  font-size: 13px;
  font-weight: 600;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-status {
  display: flex;
  align-items: center;
  gap: 5px;

  margin-top: 3px;

  color: var(--text-muted);

  font-size: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;

  display: inline-block;

  border-radius: 50%;

  background: var(--success);

  box-shadow:
    0 0 0 3px rgba(79, 209, 139, 0.08);
}

.profile-menu {
  width: 30px;
  height: 30px;
}


/* =========================================================
   NEW CHAT
========================================================= */

.new-chat {
  width: 100%;

  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  border: 0;
  border-radius: 11px;

  color: white;

  background:
    linear-gradient(
      135deg,
      #7180ff,
      #5967e2
    );

  box-shadow:
    0 8px 20px rgba(87, 103, 226, 0.18);

  font-size: 12px;
  font-weight: 700;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.new-chat svg {
  width: 17px;
  height: 17px;
}

.new-chat:hover {
  box-shadow:
    0 10px 26px rgba(87, 103, 226, 0.28);

  transform: translateY(-1px);
}

.new-chat:active {
  transform: translateY(0) scale(0.99);
}


/* =========================================================
   SEARCH
========================================================= */

.search-box {
  height: 40px;

  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 13px;

  padding: 0 12px;

  border: 1px solid transparent;
  border-radius: 10px;

  background: #181c22;

  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.search-box:focus-within {
  border-color: rgba(109, 124, 255, 0.35);
  background: #1b2027;
}

.search-box svg {
  width: 17px;
  height: 17px;

  color: var(--text-muted);

  flex: 0 0 auto;
}

.search-box input {
  width: 100%;

  border: 0;
  outline: 0;

  background: transparent;

  color: var(--text);

  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}


/* =========================================================
   SECTION LABELS
========================================================= */

.section-label {
  display: flex;
  align-items: center;

  margin: 20px 7px 7px;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.conversations-label {
  margin-top: 19px;
}


/* =========================================================
   USERS / CONVERSATIONS
========================================================= */

.users,
.conversation-list {
  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.users {
  max-height: 115px;
}

.conversation-list {
  flex: 1;
  min-height: 40px;
}

.users::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar {
  width: 4px;
}

.users::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
}

.user-row,
.conversation-row {
  width: 100%;

  display: flex;
  align-items: center;

  position: relative;

  border: 0;
  border-radius: 10px;

  padding: 9px;

  margin-bottom: 2px;

  color: var(--text);

  background: transparent;

  text-align: left;

  transition:
    background 0.15s ease;
}

.user-row:hover,
.conversation-row:hover {
  background: var(--sidebar-hover);
}

.user-row::before,
.conversation-row::before {
  content: "";

  width: 30px;
  height: 30px;

  display: grid;

  margin-right: 9px;

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      #353c49,
      #272d36
    );

  flex: 0 0 auto;
}

.user-row {
  font-size: 12px;
  font-weight: 600;
}

.conversation-row {
  min-height: 50px;

  padding-left: 9px;

  font-size: 12px;
  font-weight: 600;
}


/* =========================================================
   SIDEBAR FOOTER
========================================================= */

.sidebar-footer {
  padding-top: 10px;
}

.encryption-badge {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px;

  border-radius: 10px;

  background: rgba(79, 209, 139, 0.045);
  border: 1px solid rgba(79, 209, 139, 0.08);
}

.encryption-icon {
  width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  border-radius: 8px;

  color: var(--success);

  background: rgba(79, 209, 139, 0.08);
}

.encryption-icon svg {
  width: 16px;
  height: 16px;
}

.encryption-title {
  font-size: 10px;
  font-weight: 700;
  color: #bcefd2;
}

.encryption-description {
  margin-top: 2px;

  color: var(--text-muted);

  font-size: 9px;
}

.logout {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  height: 38px;

  margin-top: 8px;

  border: 1px solid var(--border);
  border-radius: 9px;

  color: var(--text-muted);
  background: transparent;

  font-size: 11px;
  font-weight: 600;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.logout svg {
  width: 16px;
  height: 16px;
}

.logout:hover {
  color: var(--danger);
  background: rgba(255, 111, 125, 0.05);
}


/* =========================================================
   MAIN CHAT
========================================================= */

.chat {
  min-width: 0;
  height: 100%;

  flex: 1;

  display: flex;
  flex-direction: column;

  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(109,124,255,0.045),
      transparent 38%
    ),
    var(--bg);
}


/* =========================================================
   CHAT HEADER
========================================================= */

.chat-header {
  height: 74px;
  min-height: 74px;

  display: flex;
  align-items: center;

  padding: 0 24px;

  border-bottom: 1px solid var(--border);

  background: rgba(13, 15, 18, 0.86);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  position: relative;
  z-index: 5;
}

.mobile-menu,
.mobile-back {
  display: none;
}

.chat-user {
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar-chat {
  width: 40px;
  height: 40px;

  color: #dfe3ff;

  background:
    linear-gradient(
      145deg,
      #30374a,
      #222832
    );

  border: 1px solid rgba(255,255,255,0.07);
}

.chat-user-info {
  min-width: 0;
}

.chat-user-info h2 {
  max-width: 300px;

  margin: 0;

  overflow: hidden;

  color: var(--text);

  font-size: 14px;
  font-weight: 700;

  letter-spacing: -0.01em;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-user-status {
  display: flex;
  align-items: center;
  gap: 6px;

  margin-top: 3px;

  color: var(--text-muted);

  font-size: 10px;
}

.chat-actions {
  margin-left: auto;

  display: flex;
  align-items: center;
  gap: 8px;
}

.secure-indicator {
  display: flex;
  align-items: center;
  gap: 7px;

  padding: 7px 10px;

  border: 1px solid rgba(79, 209, 139, 0.1);
  border-radius: 8px;

  color: #8bdcaf;

  background: rgba(79, 209, 139, 0.035);

  font-size: 10px;
  font-weight: 600;
}

.secure-icon {
  display: flex;
}

.secure-icon svg {
  width: 14px;
  height: 14px;
}


/* =========================================================
   MESSAGES
========================================================= */

.messages {
  flex: 1;

  min-height: 0;

  overflow-y: auto;

  padding: 28px clamp(18px, 5vw, 72px);

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;

  display: flex;
  flex-direction: column;
}

.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-thumb {
  border-radius: 10px;

  background: rgba(255,255,255,0.08);
}


/* =========================================================
   EMPTY / WELCOME
========================================================= */

.welcome-state {
  width: min(420px, 100%);

  margin: auto;

  text-align: center;
}

.welcome-icon {
  width: 68px;
  height: 68px;

  display: grid;
  place-items: center;

  margin: 0 auto 18px;

  border: 1px solid rgba(109,124,255,0.14);
  border-radius: 20px;

  color: #8994ff;

  background:
    rgba(109,124,255,0.07);

  box-shadow:
    0 15px 45px rgba(0,0,0,0.18);
}

.welcome-icon svg {
  width: 30px;
  height: 30px;
}

.welcome-state h3 {
  margin: 0;

  font-size: 17px;
  font-weight: 700;

  letter-spacing: -0.02em;
}

.welcome-state p {
  margin: 9px auto 0;

  color: var(--text-muted);

  font-size: 12px;
  line-height: 1.65;
}


/* =========================================================
   MESSAGE BUBBLES
========================================================= */

.message-row {
  width: fit-content;
  max-width: min(70%, 680px);

  display: flex;
  flex-direction: column;

  margin: 4px 0;
}

.message-row.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.message-row.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble {
  padding: 10px 13px;

  border: 1px solid rgba(255,255,255,0.045);
  border-radius: 15px;

  color: var(--text);

  background: var(--bubble);

  font-size: 13px;
  line-height: 1.55;

  word-break: break-word;

  box-shadow:
    0 3px 10px rgba(0,0,0,0.08);
}

.mine .bubble {
  color: white;

  border-color: rgba(255,255,255,0.08);

  background:
    linear-gradient(
      145deg,
      #6473f1,
      #5665df
    );
}

.message-row.theirs .bubble {
  border-bottom-left-radius: 5px;
}

.message-row.mine .bubble {
  border-bottom-right-radius: 5px;
}

.time {
  margin: 4px 6px;

  color: var(--text-muted);

  font-size: 9px;
}

.decrypt-error {
  color: #ff919a;
}


/* =========================================================
   COMPOSER
========================================================= */

.composer-wrapper {
  padding:
    8px
    clamp(12px, 4vw, 58px)
    max(14px, env(safe-area-inset-bottom));
}

.composer-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  margin-bottom: 7px;

  color: var(--text-muted);

  font-size: 9px;
}

.composer-security svg {
  width: 11px;
  height: 11px;
}

.composer {
  width: min(900px, 100%);
  min-height: 52px;

  display: flex;
  align-items: center;
  gap: 7px;

  margin: 0 auto;

  padding: 6px 7px 6px 8px;

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;

  background:
    rgba(24, 28, 34, 0.9);

  box-shadow:
    0 10px 35px rgba(0,0,0,0.18);

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.composer:focus-within {
  border-color: rgba(109,124,255,0.3);

  box-shadow:
    0 10px 35px rgba(0,0,0,0.22),
    0 0 0 3px rgba(109,124,255,0.04);
}

.composer input {
  min-width: 0;
  flex: 1;

  height: 38px;

  border: 0;
  outline: 0;

  padding: 0 6px;

  color: var(--text);
  background: transparent;

  font-size: 12px;
}

.composer input::placeholder {
  color: var(--text-muted);
}

.composer-action {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 10px;

  color: var(--text-muted);
  background: transparent;
}

.composer-action svg {
  width: 18px;
  height: 18px;
}

.send-button {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 11px;

  color: white;

  background:
    linear-gradient(
      145deg,
      #7180ff,
      #5967e2
    );

  box-shadow:
    0 5px 16px rgba(89,103,226,0.2);

  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.send-button svg {
  width: 17px;
  height: 17px;

  transform: translateX(-1px);
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.send-button:active:not(:disabled) {
  transform: scale(0.94);
}

.send-button:disabled {
  opacity: 0.35;
}


/* =========================================================
   MOBILE OVERLAY
========================================================= */

.sidebar-overlay {
  display: none;
}


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

@media (max-width: 900px) {

  :root {
    --sidebar-width: 280px;
  }

  .secure-text {
    display: none;
  }

  .secure-indicator {
    padding: 8px;
  }

  .chat-header {
    padding: 0 16px;
  }

  .messages {
    padding-left: 20px;
    padding-right: 20px;
  }

}


@media (max-width: 760px) {

  body {
    overflow: hidden;
  }

  .app {
    position: relative;
  }

  .sidebar {
    width: min(88vw, 330px);
    min-width: min(88vw, 330px);

    position: fixed;
    inset: 0 auto 0 0;

    transform: translateX(-105%);

    box-shadow:
      20px 0 50px rgba(0,0,0,0.3);

    transition:
      transform 0.25s cubic-bezier(.22,.61,.36,1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-close {
    display: grid;
  }

  .sidebar-overlay {
    display: block;

    position: fixed;
    inset: 0;

    z-index: 15;

    background: rgba(0,0,0,0.55);

    opacity: 0;
    visibility: hidden;

    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    transition:
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu {
    display: grid;

    margin-right: 4px;
  }

  .chat-header {
    height: 66px;
    min-height: 66px;

    padding: 0 12px;
  }

  .chat-user {
    gap: 9px;
  }

  .avatar-chat {
    width: 36px;
    height: 36px;
  }

  .chat-user-info h2 {
    max-width: 170px;

    font-size: 13px;
  }

  .secure-indicator {
    display: none;
  }

  .chat-actions .icon-button {
    display: none;
  }

  .messages {
    padding: 18px 12px;
  }

  .message-row {
    max-width: 84%;
  }

  .bubble {
    padding: 9px 12px;

    font-size: 12px;
  }

  .composer-wrapper {
    padding:
      7px
      10px
      max(10px, env(safe-area-inset-bottom));
  }

  .composer-security {
    display: none;
  }

  .composer {
    min-height: 48px;

    border-radius: 14px;
  }

  .composer input {
    font-size: 12px;
  }

  .send-button,
  .composer-action {
    width: 35px;
    height: 35px;
  }

}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 430px) {

  .sidebar {
    width: 90vw;
    min-width: 90vw;
  }

  .chat-user-info h2 {
    max-width: 145px;
  }

  .chat-user-status {
    font-size: 9px;
  }

  .welcome-state {
    padding: 0 20px;
  }

  .welcome-icon {
    width: 60px;
    height: 60px;

    border-radius: 18px;
  }

  .welcome-state h3 {
    font-size: 15px;
  }

  .welcome-state p {
    font-size: 11px;
  }

  .message-row {
    max-width: 88%;
  }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 350px) {

  .chat-header {
    padding: 0 8px;
  }

  .messages {
    padding-left: 8px;
    padding-right: 8px;
  }

  .composer-wrapper {
    padding-left: 7px;
    padding-right: 7px;
  }

  .mobile-menu {
    width: 32px;
    height: 32px;
  }

  .avatar-chat {
    width: 33px;
    height: 33px;
  }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

}



/* =========================================================
   AUTHENTICATION
========================================================= */

.auth-page {
  min-height: 100dvh;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    30px
    20px
    max(30px, env(safe-area-inset-bottom));

  overflow-y: auto;
  overflow-x: hidden;

  background:
    radial-gradient(
      circle at 50% -15%,
      rgba(109, 124, 255, 0.11),
      transparent 38%
    ),
    #090b0e;
}


/* =========================================================
   BACKGROUND
========================================================= */

.auth-background {
  position: fixed;
  inset: 0;

  pointer-events: none;
  overflow: hidden;
}

.auth-glow {
  position: absolute;

  width: 500px;
  height: 500px;

  border-radius: 50%;

  filter: blur(110px);

  opacity: 0.12;
}

.auth-glow-one {
  top: -280px;
  left: 50%;

  transform: translateX(-50%);

  background: #6675ff;
}

.auth-glow-two {
  right: -300px;
  bottom: -350px;

  background: #3946a5;

  opacity: 0.06;
}


/* =========================================================
   CONTAINER
========================================================= */

.auth-container {
  width: 100%;
  max-width: 420px;

  position: relative;
  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;
}


/* =========================================================
   BRAND
========================================================= */

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;

  margin-bottom: 22px;
}

.auth-brand-icon {
  width: 44px;
  height: 44px;

  display: grid;
  place-items: center;

  border-radius: 13px;

  color: white;

  background:
    linear-gradient(
      145deg,
      #7482ff,
      #5665df
    );

  box-shadow:
    0 10px 30px rgba(84, 99, 222, 0.28);
}

.auth-brand-icon svg {
  width: 23px;
  height: 23px;
}

.auth-brand-name {
  color: #f4f6f8;

  font-size: 16px;
  line-height: 19px;
  font-weight: 800;

  letter-spacing: -0.025em;
}

.auth-brand-subtitle {
  margin-top: 2px;

  color: #69717e;

  font-size: 10px;
  font-weight: 500;
}


/* =========================================================
   CARD
========================================================= */

.auth-card {
  width: 100%;

  padding: 30px;

  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      rgba(22, 26, 32, 0.96),
      rgba(14, 17, 21, 0.96)
    );

  box-shadow:
    0 30px 80px rgba(0,0,0,0.35),
    0 1px 0 rgba(255,255,255,0.025) inset;

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}


/* =========================================================
   HEADING
========================================================= */

.auth-heading {
  margin-bottom: 25px;
}

.auth-heading h1 {
  margin: 0;

  color: #f5f7fa;

  font-size: 22px;
  line-height: 28px;
  font-weight: 750;

  letter-spacing: -0.035em;
}

.auth-heading p {
  margin: 7px 0 0;

  color: #747d8a;

  font-size: 11px;
  line-height: 1.65;
}


/* =========================================================
   FORM FIELDS
========================================================= */

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;

  margin: 0 0 7px 2px;

  color: #aeb5c0;

  font-size: 10px;
  font-weight: 600;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
}

.input-wrapper {
  height: 46px;

  display: flex;
  align-items: center;

  position: relative;

  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 11px;

  background: #181c22;

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.input-wrapper:focus-within {
  border-color: rgba(109,124,255,0.55);

  background: #1a1f26;

  box-shadow:
    0 0 0 3px rgba(109,124,255,0.075);
}

.input-icon {
  width: 17px;
  height: 17px;

  margin-left: 13px;

  flex: 0 0 auto;

  color: #5f6875;

  transition:
    color 0.18s ease;
}

.input-wrapper:focus-within .input-icon {
  color: #8290ff;
}

.input-wrapper input {
  width: 100%;
  height: 100%;

  min-width: 0;

  padding:
    0
    42px
    0
    10px;

  border: 0;
  outline: 0;

  color: #f1f3f6;

  background: transparent;

  font-size: 12px;
}

.input-wrapper input::placeholder {
  color: #59616d;
}

.input-wrapper input:-webkit-autofill,
.input-wrapper input:-webkit-autofill:hover,
.input-wrapper input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f1f3f6;

  box-shadow:
    0 0 0 1000px #181c22 inset;

  transition:
    background-color 9999s ease-in-out 0s;
}


/* =========================================================
   PASSWORD TOGGLE
========================================================= */

.password-toggle {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  position: absolute;
  right: 5px;
  top: 5px;

  padding: 0;

  border: 0;
  border-radius: 8px;

  color: #606976;
  background: transparent;

  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.password-toggle:hover {
  color: #aeb5c0;
  background: rgba(255,255,255,0.045);
}

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


/* =========================================================
   ERROR
========================================================= */

.auth-error {
  min-height: 0;

  display: none;

  align-items: flex-start;
  gap: 8px;

  margin:
    4px
    0
    12px;

  padding: 9px 11px;

  border: 1px solid rgba(255,111,125,0.13);
  border-radius: 9px;

  color: #ff9aa3;

  background: rgba(255,111,125,0.055);

  font-size: 10px;
  line-height: 1.5;
}

.auth-error.visible {
  display: flex;
}

.auth-error::before {
  content: "!";

  width: 15px;
  height: 15px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 50%;

  color: #ff9aa3;

  border: 1px solid rgba(255,111,125,0.3);

  font-size: 9px;
  font-weight: 700;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.auth-primary {
  width: 100%;
  height: 46px;

  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 11px;

  color: white;

  background:
    linear-gradient(
      135deg,
      #7180ff,
      #5967e2
    );

  box-shadow:
    0 9px 25px rgba(83,99,220,0.2);

  font-size: 12px;
  font-weight: 700;

  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.auth-primary:hover:not(:disabled) {
  transform: translateY(-1px);

  box-shadow:
    0 12px 30px rgba(83,99,220,0.3);
}

.auth-primary:active:not(:disabled) {
  transform: scale(0.99);
}

.auth-primary:disabled {
  cursor: not-allowed;
}

.auth-primary.loading {
  opacity: 0.82;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-content svg {
  width: 17px;
  height: 17px;
}


/* =========================================================
   LOADER
========================================================= */

.button-loader {
  width: 15px;
  height: 15px;

  display: none;

  position: absolute;

  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;

  border-radius: 50%;

  animation:
    auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================================================
   SECONDARY BUTTON
========================================================= */

.auth-secondary {
  width: 100%;
  height: 43px;

  margin-top: 8px;

  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px;

  color: #aab1bc;

  background: transparent;

  font-size: 11px;
  font-weight: 600;

  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.auth-secondary:hover:not(:disabled) {
  color: #e1e4e9;

  border-color: rgba(255,255,255,0.13);

  background: rgba(255,255,255,0.035);
}

.auth-secondary:disabled {
  opacity: 0.5;
}


/* =========================================================
   SECURITY
========================================================= */

.auth-security {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-top: 24px;
  padding-top: 18px;

  border-top: 1px solid rgba(255,255,255,0.055);
}

.auth-security-icon {
  width: 31px;
  height: 31px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 9px;

  color: #69d79a;

  background: rgba(79,209,139,0.065);
}

.auth-security-icon svg {
  width: 16px;
  height: 16px;
}

.auth-security-title {
  color: #a9dfc0;

  font-size: 10px;
  font-weight: 700;
}

.auth-security-text {
  margin-top: 2px;

  color: #5f6874;

  font-size: 9px;
  line-height: 1.4;
}


/* =========================================================
   FOOTER
========================================================= */

.auth-footer {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-top: 18px;

  color: #4f5762;

  font-size: 9px;
  font-weight: 500;
}

.footer-dot {
  color: #333941;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 520px) {

  .auth-page {
    align-items: flex-start;

    padding:
      44px
      15px
      max(24px, env(safe-area-inset-bottom));
  }

  .auth-container {
    max-width: 430px;
  }

  .auth-brand {
    margin-bottom: 19px;
  }

  .auth-card {
    padding: 23px 18px 19px;

    border-radius: 17px;
  }

  .auth-heading {
    margin-bottom: 21px;
  }

  .auth-heading h1 {
    font-size: 20px;
  }

  .auth-heading p {
    font-size: 10px;
  }

  .auth-footer {
    margin-top: 15px;
  }

}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 360px) {

  .auth-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .auth-card {
    padding: 21px 15px 17px;
  }

  .auth-brand-icon {
    width: 40px;
    height: 40px;
  }

  .auth-brand-name {
    font-size: 15px;
  }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    animation: none !important;

    transition: none !important;
  }

}