* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  color: var(--color-text, #1a202c);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 700px 600px at 85% 10%, rgba(16, 185, 129, .15), transparent 50%),
    radial-gradient(ellipse 800px 700px at 10% 90%, rgba(46, 117, 182, .12), transparent 50%),
    linear-gradient(135deg, #f0f7ff 0%, #ffffff 50%, #ecfdf5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

/* Decorative floating shapes */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 500px; height: 500px;
  background: rgba(16, 185, 129, .25);
  top: -150px; right: -150px;
  animation: float-blob 15s ease-in-out infinite;
}
body::after {
  width: 600px; height: 600px;
  background: rgba(46, 117, 182, .22);
  bottom: -200px; left: -200px;
  animation: float-blob 18s ease-in-out infinite reverse;
}
@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -40px) scale(1.1); }
}

/* Geometric pattern overlay */
.auth-pattern {
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(46, 117, 182, .08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.auth-container {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: white;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow:
    0 20px 60px rgba(31, 56, 100, .12),
    0 4px 20px rgba(31, 56, 100, .06);
  border: 1px solid rgba(255, 255, 255, .8);
  position: relative;
}

.brand {
  display: block;
  text-decoration: none;
  text-align: center;
  margin-bottom: .3rem;
}
.brand h1 {
  font-size: 2.4rem;
  font-weight: 900;
  color: #1f3864;
  letter-spacing: -.02em;
  margin: 0;
}
.brand h1 .dot {
  color: #10b981;
}

.auth-tagline {
  text-align: center;
  color: #718096;
  font-size: .85rem;
  margin-bottom: 1.8rem;
  font-weight: 500;
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0d1f3c;
  text-align: center;
  margin-bottom: .4rem;
  letter-spacing: -.01em;
}

.auth-subtitle {
  text-align: center;
  color: #718096;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* OAuth buttons */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.5rem;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  padding: .85rem 1rem;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 12px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: #1a202c;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-oauth:hover {
  border-color: #cbd5e0;
  background: #f8faff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.btn-oauth svg, .btn-oauth img {
  width: 22px; height: 22px;
  flex-shrink: 0;
}

.divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
  color: #a0aec0;
  font-size: .82rem;
  font-weight: 500;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 50px);
  height: 1px;
  background: #e2e8f0;
}
.divider::before { right: 0; }
.divider::after { left: 0; }

/* Form fields */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: .35rem;
}

.input-wrapper {
  position: relative;
}
.input-wrapper .icon-prefix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  pointer-events: none;
  width: 18px;
  height: 18px;
}
.input-wrapper .icon-suffix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-wrapper .icon-suffix:hover { color: #2e75b6; }

.form-input {
  width: 100%;
  padding: .85rem 2.6rem .85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: .95rem;
  font-family: inherit;
  background: #f7fafc;
  color: #1a202c;
  transition: all .2s;
  direction: rtl;
}
.input-wrapper.has-suffix .form-input { padding-left: 2.6rem; }
.form-input:focus {
  outline: none;
  border-color: #2e75b6;
  background: white;
  box-shadow: 0 0 0 3px rgba(46, 117, 182, .15);
}
.form-input::placeholder { color: #a0aec0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}

/* Role picker */
.role-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}
.role-btn {
  padding: .9rem .5rem;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-family: inherit;
}
.role-btn:hover {
  border-color: #cbd5e0;
  background: white;
}
.role-btn.active {
  border-color: #10b981;
  background: #ecfdf5;
}
.role-btn .icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: .3rem;
}
.role-btn .label {
  font-size: .85rem;
  font-weight: 700;
  color: #1a202c;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: .95rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, .3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, .4);
}
.btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Messages */
.alert {
  padding: .8rem 1rem;
  border-radius: 10px;
  font-size: .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-right: 3px solid #dc2626;
}
.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-right: 3px solid #10b981;
}
.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-right: 3px solid #2e75b6;
}

.alt-action {
  text-align: center;
  margin-top: 1.2rem;
  font-size: .9rem;
  color: #4a5568;
}
.alt-action a {
  color: #2e75b6;
  font-weight: 700;
  text-decoration: none;
}
.alt-action a:hover { text-decoration: underline; }

.legal {
  text-align: center;
  font-size: .75rem;
  color: #a0aec0;
  margin-top: 1.2rem;
  line-height: 1.5;
}
.legal a { color: #4a5568; }

/* Code input - 6 digit boxes */
.code-input {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin: 1.5rem 0;
  direction: ltr;
  flex-wrap: nowrap;
}
.code-input input {
  flex: 0 0 auto;
  width: 50px; height: 60px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: #1f3864;
  font-family: monospace;
  background: #f7fafc;
  transition: all .15s;
  padding: 0;
  box-sizing: border-box;
  margin: 0;
}
.code-input input:focus {
  outline: none;
  border-color: #10b981;
  background: white;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
.code-input input.filled {
  background: #ecfdf5;
  border-color: #10b981;
  color: #1f3864;
}

.device-info {
  background: #f0f7ff;
  border-right: 3px solid #2e75b6;
  padding: .9rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.device-info .label { font-size: .78rem; color: #718096; margin-bottom: .25rem; }
.device-info .name { font-weight: 700; color: #1f3864; font-size: .95rem; }
.device-info .email { font-size: .8rem; color: #718096; margin-top: .3rem; }
.device-info .email strong { color: #1a202c; }

.resend-area {
  text-align: center;
  margin-top: 1rem;
  font-size: .88rem;
  color: #718096;
}
.resend-btn {
  background: none;
  border: none;
  color: #2e75b6;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: .88rem;
  padding: .3rem;
}
.resend-btn:disabled { color: #a0aec0; cursor: not-allowed; }

.back-link {
  display: block;
  text-align: center;
  margin-top: 1.2rem;
  color: #718096;
  text-decoration: none;
  font-size: .88rem;
}
.back-link:hover { color: #2e75b6; }

@media (max-width: 480px) {
  body { padding: 1rem .5rem; }
  .auth-card { padding: 1.8rem 1.4rem; border-radius: 18px; }
  .brand h1 { font-size: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .role-picker { grid-template-columns: 1fr; }
  .role-btn { padding: .7rem; display: flex; align-items: center; gap: .8rem; text-align: right; }
  .role-btn .icon { display: inline-block; margin: 0; font-size: 1.4rem; }
  .code-input input { width: 42px; height: 54px; font-size: 1.4rem; }
}
@media (max-width: 360px) {
  .code-input { gap: .25rem; }
  .code-input input { width: 38px; height: 48px; font-size: 1.2rem; }
}


/* Avatar with image - white background, no gradient */
.user-avatar:has(img),
.q-avatar:has(img),
.pro-avatar:has(img),
.avatar:has(img),
[class*="avatar"]:has(img) {
  background: white !important;
  background-image: none !important;
}

.user-avatar img,
.q-avatar img,
.pro-avatar img,
.avatar img,
[class*="avatar"] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
