/* =========================================================
   Qaflo - Ready Upload UI
   Theme: light gray + deep graphite
   ========================================================= */

:root {
  --bg: #edf0f4;
  --bg-2: #f8f9fb;
  --card: #ffffff;
  --dark: #181b21;
  --dark-2: #252a33;
  --dark-3: #373e49;
  --soft: #f1f3f6;
  --soft-2: #e4e8ee;
  --line: #d7dce5;
  --text: #111827;
  --muted: #6b7280;
  --white: #ffffff;
  --danger: #ef4444;
  --success: #16a34a;
  --shadow: 0 30px 90px rgba(17, 24, 39, 0.16);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 15px;
  --font: "Cairo", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(24, 27, 33, 0.14), transparent 34%),
    radial-gradient(circle at bottom left, rgba(55, 62, 73, 0.10), transparent 32%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-page,
.room-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell {
  width: min(1100px, 100%);
  min-height: 690px;
  display: grid;
  grid-template-columns: 0.96fr 1.04fr;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.9);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 36px;
  color: var(--white);
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,0.15), transparent 30%),
    linear-gradient(145deg, var(--dark), var(--dark-3));
}

.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}

.hero-panel::before {
  width: 290px;
  height: 290px;
  top: -120px;
  left: -85px;
}

.hero-panel::after {
  width: 230px;
  height: 230px;
  right: -70px;
  bottom: -80px;
}

.brand,
.mobile-brand,
.room-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  flex: 0 0 60px;
  border-radius: 22px;
  color: var(--dark);
  background: linear-gradient(135deg, #ffffff, #c8ced8);
  box-shadow: 0 20px 45px rgba(0,0,0,0.25);
  font-size: 32px;
  font-weight: 900;
}

.brand-mark.small {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border-radius: 16px;
  font-size: 24px;
}

.brand h1,
.mobile-brand h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}

.brand p,
.mobile-brand p {
  margin: 7px 0 0;
  color: rgba(255,255,255,0.68);
  direction: ltr;
}

.hero-text {
  position: relative;
  z-index: 1;
  margin-top: 118px;
}

.hero-pill {
  display: inline-flex;
  direction: ltr;
  padding: 8px 13px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 12px;
  font-weight: 900;
}

.hero-text h2 {
  max-width: 540px;
  margin: 20px 0 14px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.23;
  letter-spacing: -0.8px;
}

.hero-text p {
  max-width: 510px;
  margin: 0;
  color: rgba(255,255,255,0.72);
  line-height: 1.9;
}

.hero-cards {
  position: absolute;
  z-index: 1;
  left: 36px;
  right: 36px;
  bottom: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.hero-cards div {
  min-height: 102px;
  padding: 15px;
  border-radius: 19px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(10px);
}

.hero-cards strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.hero-cards span {
  color: rgba(255,255,255,0.68);
  font-size: 12px;
  line-height: 1.65;
}

.auth-panel {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(24,27,33,0.05), transparent 28%),
    linear-gradient(180deg, #fff, #f7f8fa);
}

.mobile-brand {
  display: none;
  margin-bottom: 24px;
}

.mobile-brand .brand-mark {
  color: #fff;
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
}

.mobile-brand h1 {
  color: var(--dark);
}

.mobile-brand p {
  color: var(--muted);
}

.tabbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 7px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: #e9edf2;
  border: 1px solid #dde2ea;
}

.tab-btn {
  height: 49px;
  border: 0;
  border-radius: 15px;
  color: #6b7280;
  background: transparent;
  font-weight: 900;
  transition: 0.22s ease;
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
  box-shadow: 0 14px 32px rgba(24, 27, 33, 0.18);
}

.form-panel {
  display: none;
  animation: fadeUp 0.25s ease both;
}

.form-panel.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-title {
  margin: 14px 0 23px;
}

.form-title h3 {
  margin: 0 0 6px;
  color: var(--dark);
  font-size: 31px;
}

.form-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 900;
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 55px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: #f8fafc;
  outline: none;
  transition: 0.22s ease;
}

input::placeholder {
  color: #9ca3af;
}

input:focus,
select:focus {
  background: #fff;
  border-color: #606978;
  box-shadow: 0 0 0 4px rgba(55, 62, 73, 0.10);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input-row button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--dark);
  background: #e5e9ef;
  font-weight: 900;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 55px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 900;
  transition: 0.22s ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
  box-shadow: 0 16px 38px rgba(24, 27, 33, 0.20);
}

.secondary-btn {
  color: var(--dark);
  background: #edf0f4;
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.note-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 14px;
  border-radius: 18px;
  background: #eef1f5;
  border: 1px solid #e0e5ec;
}

.note-box span {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--dark-3);
}

.note-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(8px);
}

.modal.active {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(480px, 100%);
  padding: 31px;
  border-radius: 31px;
  background: #fff;
  box-shadow: 0 35px 95px rgba(17, 24, 39, 0.32);
  text-align: center;
  animation: pop 0.25s ease both;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 37px;
  height: 37px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #eef1f5;
  font-size: 24px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
  font-size: 35px;
  font-weight: 900;
}

.modal-card h3 {
  margin: 0 0 6px;
  color: var(--dark);
  font-size: 28px;
}

.modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.room-data {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  text-align: right;
}

.room-data div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 17px;
  background: #f4f6f8;
  border: 1px solid #e3e7ee;
}

.room-data span {
  color: var(--muted);
  font-weight: 800;
}

.room-data strong {
  color: var(--dark);
  direction: ltr;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(50%) translateY(14px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--dark);
  box-shadow: 0 18px 45px rgba(17, 24, 39, 0.28);
  transition: 0.25s ease;
  font-weight: 900;
}

.toast.active {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

/* Chat Room */
.chat-shell {
  width: min(900px, 100%);
  height: min(770px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 31px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.9);
}

.chat-header {
  min-height: 80px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
}

.room-title h1 {
  margin: 0 0 4px;
  font-size: 20px;
  direction: ltr;
  text-align: right;
}

.room-title p {
  margin: 0;
  color: rgba(255,255,255,0.70);
  direction: ltr;
  text-align: right;
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-code,
.exit-btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255,255,255,0.11);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.messages {
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(55,62,73,0.08), transparent 34%),
    #f4f6f8;
}

.system-msg {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: #e7ebf0;
  font-size: 13px;
  font-weight: 800;
}

.msg {
  width: fit-content;
  max-width: min(74%, 560px);
  margin-bottom: 11px;
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 22px rgba(17,24,39,0.06);
  overflow-wrap: anywhere;
}

.msg.me {
  margin-right: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
}

.msg strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  opacity: 0.75;
}

.msg small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  opacity: 0.62;
  direction: ltr;
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
}

.composer {
  display: grid;
  grid-template-columns: 52px 1fr 96px;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-top: 1px solid #e1e5ea;
}

.attach-btn {
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--dark-3);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.composer input {
  height: 52px;
}

.composer button {
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--dark);
  font-weight: 900;
}

@media (max-width: 900px) {
  .auth-page,
  .room-page {
    padding: 14px;
  }

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

  .hero-panel {
    display: none;
  }

  .mobile-brand {
    display: flex;
  }

  .auth-panel {
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .tabbar,
  .modal-actions,
  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row button {
    height: 48px;
  }

  .form-title h3 {
    font-size: 26px;
  }

  .chat-shell {
    height: calc(100vh - 28px);
    border-radius: 23px;
  }

  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .copy-code,
  .exit-btn {
    flex: 1;
  }

  .composer {
    grid-template-columns: 46px 1fr 74px;
    gap: 7px;
    padding: 10px;
  }

  .msg {
    max-width: 88%;
  }
}
