
/* Premium Fintech Portal Layout: 2-Column on Desktop, Native App on Mobile */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.app-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #080d14;
  background-image: linear-gradient(135deg, rgba(11, 18, 28, 0.92) 0%, rgba(5, 10, 16, 0.96) 100%), url("./page-bg.webp");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 16px;
}

/* Master Desktop Workspace */
.chat-workspace {
  width: 100%;
  max-width: 1060px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 720px;
  position: relative;
}

/* LEFT SIDEBAR (Desktop) */
.brand-sidebar {
  width: 380px;
  background: #0f172a;
  color: #f8fafc;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.brand-sidebar::before {
  content: "";
  position: absolute;
  top: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 2;
}

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

.sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(2, 132, 199, 0.4));
}

.sidebar-brand-name {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.sidebar-headline {
  font-size: 15px;
  line-height: 1.5;
  color: #94a3b8;
  font-weight: 400;
}

.consultant-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.consultant-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.consultant-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0284c7;
}

.pulse-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2.5px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
}

.consultant-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.consultant-details strong {
  font-size: 16px;
  color: #ffffff;
  font-weight: 700;
}

.consultant-details small {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 500;
}

.consultant-details .rating {
  font-size: 11px;
  color: #fbbf24;
  margin-top: 2px;
  font-weight: 600;
}

.sidebar-perks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.perk-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
}

.perk-icon {
  width: 22px;
  height: 22px;
  background: rgba(2, 132, 199, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #38bdf8;
  font-size: 12px;
}

.sidebar-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.dot-live {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

/* RIGHT MAIN CHAT PANEL */
.main-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  min-height: 720px;
  overflow: hidden;
  position: relative;
}

/* Desktop Header */
.panel-header {
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.panel-header-mobile-meta {
  display: none;
  align-items: center;
  gap: 12px;
}

.mobile-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.mobile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #fff;
  border-radius: 50%;
}

.mobile-names strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
}

.mobile-names small {
  font-size: 11px;
  color: #10b981;
  font-weight: 500;
}

.panel-header-desktop-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header-desktop-title h2 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.badge-official {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-hanfa-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #0369a1;
  font-weight: 600;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 6px 14px;
  border-radius: 100px;
}

/* Chat Feed */
.chat-scroll-area {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  animation: fadeInMsg 0.3s ease-out;
  word-wrap: break-word;
}

.message-bubble.incoming {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.message-bubble.outgoing {
  align-self: flex-end;
  background: #0284c7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  font-weight: 500;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Options / Choice buttons */
.options-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  animation: fadeInMsg 0.35s ease-out;
}

.choice-btn {
  background: #ffffff;
  color: #0284c7;
  border: 1.5px solid #0284c7;
  border-radius: 100px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.choice-btn:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.choice-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Typing Indicator */
.typing-indicator {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* REGISTRATION FORM CARD (DESKTOP 2-COLUMN GRID) */
.reg-form-card {
  margin-top: 14px;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  animation: fadeInMsg 0.4s ease-out;
}

.form-head {
  text-align: center;
  margin-bottom: 22px;
}

.form-head-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.form-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.form-head-logo h3 {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
}

.form-head-subtitle {
  font-size: 13px;
  color: #64748b;
}

/* Desktop Grid for inputs */
.form-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  text-align: left;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-group.has-error input {
  border-color: #ef4444;
  background: #fef2f2;
}

.field-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
  display: none;
}

.form-group.has-error .field-error {
  display: block;
}

/* Phone input with Croatian flag */
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  transition: all 0.2s ease;
}

.phone-input-wrap:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-group.has-error .phone-input-wrap {
  border-color: #ef4444;
  background: #fef2f2;
}

.country-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 12px;
  background: #f8fafc;
  border-right: 1.5px solid #e2e8f0;
  user-select: none;
  flex-shrink: 0;
}

.croatia-flag {
  display: block;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.dial-code {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.phone-input-wrap input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
}

/* Email chips */
.email-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.email-chips .chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: #475569;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.email-chips .chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Consent */
.form-consent {
  margin: 8px 0 18px 0;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.consent-label input {
  margin-top: 2px;
  accent-color: #0284c7;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.submit-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.7s infinite linear;
}

@keyframes btnSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.form-global-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.guarantee-note {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

/* Success Card */
.success-card {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  animation: fadeInMsg 0.4s ease-out;
}

.success-icon-wrap {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px auto;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.success-icon-wrap svg {
  width: 34px;
  height: 34px;
  stroke: #ffffff;
}

.success-card h3 {
  font-size: 20px;
  color: #14532d;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-card p {
  font-size: 14px;
  color: #166534;
  line-height: 1.5;
}

.success-card .redirect-note {
  margin-top: 14px;
  font-size: 13px;
  color: #15803d;
  font-weight: 600;
}

/* RESPONSIVE BREAKPOINT (MOBILE / TABLET) */
@media (max-width: 880px) {
  body.app-body {
    padding: 0;
    align-items: stretch;
  }
  .chat-workspace {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    flex-direction: column;
  }
  .brand-sidebar {
    display: none; /* Hide heavy sidebar on mobile */
  }
  .main-chat-panel {
    min-height: 100vh;
  }
  .panel-header-desktop-title {
    display: none;
  }
  .panel-header-mobile-meta {
    display: flex;
  }
  .panel-header {
    padding: 12px 16px;
  }
  .chat-scroll-area {
    padding: 16px 14px;
  }
  .message-bubble {
    max-width: 88%;
  }
  .form-grid-row {
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 0;
  }
  .reg-form-card {
    padding: 22px 16px;
  }
}
