:root {
  --uc-purple: #5B4CDB;
  --uc-purple-dark: #3F35B5;
  --uc-purple-soft: #EEEAFE;
  --uc-purple-light: #F6F3FF;
  --uc-text: #22223A;
  --uc-muted: #6B7280;
  --uc-border: #E5E7EB;
  --uc-bg: #F3F0FF;
  --uc-white: #FFFFFF;
  --uc-shadow: 0 18px 45px rgba(91, 76, 219, 0.18);
  --uc-radius: 24px;
}

/* Global reset */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--uc-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 35%),
    linear-gradient(180deg, #F8F6FF 0%, #F3F0FF 45%, #EEF2FF 100%);
  color: var(--uc-text);
}

/* Improve mobile scrolling */
body,
button,
input,
select,
textarea {
  font: inherit;
}

/* General page wrapper */
.app-container,
.container,
.main-container,
.page-container,
.landing-container,
.login-container,
.signup-container,
.form-container {
  width: min(100%, 430px);
  margin: 0 auto;
}

/* Landing/home page */
body:has(.landing-page),
body:has(.hero-card) {
  min-height: 100dvh;
}

.landing-page {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
}

.hero-card {
  width: min(100%, 430px);
  text-align: center;
  padding: 34px 24px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: var(--uc-shadow);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.hero-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7C3AED 0%, #5B4CDB 55%, #251956 100%);
  color: white;
  font-size: 48px;
  font-weight: 800;
  box-shadow: 0 18px 35px rgba(91, 76, 219, 0.28);
}

.hero-card h1,
.landing-page h1,
h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--uc-text);
}

.hero-card p,
.landing-page p {
  margin: 0 0 26px;
  color: var(--uc-muted);
  font-size: 16px;
  line-height: 1.5;
}

.hero-actions,
.button-group,
.auth-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

/* Buttons */
button,
.btn,
.primary-button,
.secondary-button,
input[type="submit"],
a.button {
  min-height: 48px;
  border-radius: 15px;
  padding: 13px 20px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button,
.btn-primary,
.primary-button,
input[type="submit"] {
  background: linear-gradient(135deg, #7C3AED, var(--uc-purple));
  color: white;
  box-shadow: 0 12px 22px rgba(91, 76, 219, 0.24);
}

.btn-secondary,
.secondary-button,
a.secondary-button {
  background: white;
  color: var(--uc-purple);
  border: 2px solid var(--uc-purple);
  box-shadow: none;
}

button:active,
.btn:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

/* Forms: login and signup */
form {
  width: 100%;
}

.login-card,
.signup-card,
.auth-card,
form {
  max-width: 430px;
}

.login-container,
.signup-container,
.auth-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

.login-box,
.signup-box,
.form-card,
.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 28px 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--uc-shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.login-box h1,
.signup-box h1,
.form-card h1,
.auth-card h1,
.login-box h2,
.signup-box h2,
.form-card h2,
.auth-card h2 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 14px 15px;
  margin-bottom: 14px;
  border: 1px solid #D8D5EA;
  border-radius: 15px;
  background: #FFFFFF;
  color: var(--uc-text);
  outline: none;
  font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--uc-purple);
  box-shadow: 0 0 0 4px rgba(91, 76, 219, 0.13);
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--uc-text);
  font-weight: 700;
  font-size: 14px;
}

/* Full-width form buttons */
form button,
form input[type="submit"],
.login-box button,
.signup-box button,
.form-card button,
.auth-card button {
  width: 100%;
  margin-top: 6px;
}

/* Modal improvement */
.modal,
.custom-modal {
  padding: 20px;
}

.modal-content,
.custom-modal-content {
  width: min(92vw, 380px);
  border-radius: 26px;
  padding: 28px 22px;
  box-shadow: var(--uc-shadow);
}

/* Dashboard/app pages */
.mobile-header,
.app-header,
header {
  width: 100%;
  padding: calc(16px + env(safe-area-inset-top)) 18px 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  position: sticky;
  top: 0;
  z-index: 20;
}

.mobile-header h1,
.app-header h1,
header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.page-content,
.dashboard-content,
main {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 18px;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.card,
.mobile-card,
.dashboard-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px rgba(91, 76, 219, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Bottom mobile nav if you use one */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 430px);
  min-height: 64px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  z-index: 40;
}

.bottom-nav a {
  color: var(--uc-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--uc-purple);
}

/* Messages */
.conversation-item {
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
  background: white;
  border: 1px solid var(--uc-border);
}

.conversation-item.active {
  border-color: var(--uc-purple);
  background: var(--uc-purple-light);
}

.message {
  max-width: 82%;
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.message.sent {
  margin-left: auto;
  background: linear-gradient(135deg, #7C3AED, var(--uc-purple));
  color: white;
}

.message.received {
  margin-right: auto;
  background: white;
  color: var(--uc-text);
  border: 1px solid var(--uc-border);
}

/* Desktop/tablet enhancement */
@media (min-width: 768px) {
  .hero-card {
    padding: 44px 36px;
  }

  .login-box,
  .signup-box,
  .form-card,
  .auth-card {
    padding: 36px;
  }

  .page-content,
  .dashboard-content,
  main {
    max-width: 900px;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .hero-actions,
  .button-group,
  .auth-actions {
    flex-direction: column;
  }

  .btn,
  button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .hero-card h1,
  h1 {
    font-size: 28px;
  }
}