/* =============================================
   UPFY APP — STYLESHEET
   ============================================= */

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

:root {
  --bg: #09090f;
  --bg-base: #09090f;
  --bg2: #0f0f1a;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --purple: #7c3aed;
  --pink: #ec4899;
  --brand-pink: #ec4899;
  --brand-orange: #f97316;
  --grad: linear-gradient(135deg, #7c3aed, #ec4899);
  --grad-text: linear-gradient(90deg, #a78bfa, #f472b6);
  --text: #f1f1f1;
  --text-secondary: #9ca3af;
  --text-muted: #9ca3af;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
  --font-inter: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-bg-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.25) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-img {
  width: 120px;
  height: auto;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 32px;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.login-logo p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.form-input:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.btn-login {
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.6);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-footer a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.2s;
}

.login-footer a:hover {
  color: #ec4899;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1001;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  margin-bottom: 0;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-container {
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.dashboard-logo {
  display: flex;
  align-items: center;
}

.dashboard-logo-img {
  width: 100px;
  height: auto;
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-cpf {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-content {
  max-width: 800px;
  margin: 0 auto;
}

.welcome-section {
  text-align: center;
  margin-bottom: 32px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

.specialists-section {
  margin-bottom: 32px;
}

.subscription-section {
  margin-bottom: 32px;
}

.subscription-content {
  min-height: 200px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.subscription-error {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.btn-retry {
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--grad);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.no-subscription {
  text-align: center;
  padding: 40px 20px;
}

.no-sub-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-sub-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-muted);
}

.no-subscription h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.no-subscription p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-subscribe {
  display: inline-block;
  padding: 12px 24px;
  background: var(--grad);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-subscribe:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.subscription-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.subscription-card.active {
  border-color: rgba(124,58,237,0.4);
}

.subscription-card.inactive {
  border-color: rgba(236,72,153,0.4);
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.subscription-plan {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.subscription-status {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-status.active {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.3);
}

.subscription-status.inactive {
  background: rgba(236,72,153,0.15);
  color: #f472b6;
  border: 1px solid rgba(236,72,153,0.3);
}

.subscription-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-label {
  font-size: 14px;
  color: var(--text-muted);
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.payments-history {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.payments-history h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.payment-date {
  font-size: 13px;
  color: var(--text-muted);
}

.payment-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.payment-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
}

.payment-status.aprovado {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
}

.payment-status.pendente {
  background: rgba(249,115,22,0.15);
  color: #fbbf24;
}

.payment-status.cancelado {
  background: rgba(236,72,153,0.15);
  color: #f472b6;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.section-header-with-back {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.back-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

.main-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.main-option-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 10px;
}

.main-option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,58,237,0.4);
  box-shadow: 0 4px 20px rgba(124,58,237,0.15);
}

.main-option-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(236,72,153,0.12));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-option-icon svg {
  width: 12px;
  height: 12px;
  stroke: #a78bfa;
  stroke-width: 1.75;
}

.main-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.main-option-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.main-option-desc {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.1;
}

.specialists-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .specialists-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.specialist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.specialist-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,0.4);
  box-shadow: 0 8px 30px rgba(124,58,237,0.2);
}

.specialist-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(236,72,153,0.12));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.specialist-icon svg {
  width: 28px;
  height: 28px;
  stroke: #a78bfa;
  stroke-width: 1.75;
}

.specialist-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.specialist-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =============================================
   SPECIALIST CHAT
   ============================================= */
.chat-container {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 20px;
}

.chat-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.chat-back:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.chat-back svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

.chat-specialist-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chat-logo {
  width: 40px;
  height: auto;
}

.chat-specialist-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(236,72,153,0.12));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-specialist-icon svg {
  width: 24px;
  height: 24px;
  stroke: #a78bfa;
  stroke-width: 1.75;
}

.chat-specialist-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.chat-specialist-type {
  font-size: 13px;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.message {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message-ai {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-user {
  background: var(--grad);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: calc(100% - 40px);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  transition: border 0.2s, box-shadow 0.2s;
}

.chat-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.chat-input:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.chat-send {
  background: var(--grad);
  border: none;
  border-radius: 50px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.chat-send svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
  .login-card {
    padding: 32px 24px;
  }

  .specialists-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .user-info {
    text-align: center;
  }

  .chat-header {
    margin: 16px;
  }

  .chat-messages {
    padding: 16px;
  }

  .chat-input-area {
    margin: 16px;
    width: calc(100% - 32px);
  }
}
