/* ChatGibidy Styles */

:root {
  --color-bg: #ffffff;
  --color-text: #333333;
  /* Softer, modern blue accent (OpenAI-esque tone) */
  --color-accent: #111111;
  --color-secondary: #6c757d;
  --color-success: #28a745;
  --color-danger: #dc3545;
  --color-warning: #ffc107;
  --color-info: #17a2b8;
  --color-light: #f8f9fa;
  --color-dark: #343a40;
  --color-gray: #adb5bd;
  --color-border: #dee2e6;
  --shadow: 0 2px 5px rgba(0,0,0,0.1);
  --radius: 0.375rem;
}

[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-text: #e0e0e0;
  --color-accent: #f5f5f5;
  --color-secondary: #adb5bd;
  --color-light: #343a40;
  --color-dark: #f8f9fa;
  --color-border: #444444;
  --shadow: 0 2px 5px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  padding: 1rem;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

button, .btn {
  padding: 0.5rem 1rem;
  background-color: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover, .btn:hover {
  /* slightly lighter hover to feel less heavy */
  background-color: var(--color-text);
  transform: translateY(-1px);
}

button:active, .btn:active {
  transform: translateY(1px);
}

input, textarea, select {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

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

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand-lockup:hover {
  color: inherit;
}

.brand-mark {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  background: #fff;
  object-fit: cover;
}

.brand-lockup h1 {
  margin: 0;
}

.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-secondary);
}

/* Chat components */
#messages {
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.5rem;
  background-color: var(--color-light);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
}

.msg {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-radius: var(--radius);
  max-width: 85%;
}

.user-msg {
  background-color: var(--color-accent);
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.bot-msg {
  background-color: var(--color-light);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.system-msg {
  background-color: var(--color-secondary);
  color: white;
  font-size: 0.875rem;
  opacity: 0.8;
  text-align: center;
  max-width: 100%;
}

/* Input area */
.input-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.auth-page {
  min-height: 100vh;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(91, 140, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 52%, #f4f7fb 100%);
}

[data-theme="dark"].auth-page {
  background:
    radial-gradient(circle at top left, rgba(122, 162, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #0f172a 0%, #111827 48%, #020617 100%);
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 420px);
  gap: 1.5rem;
}

.auth-hero,
.auth-card {
  border: 1px solid rgba(222, 226, 230, 0.9);
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.auth-hero {
  padding: 2.5rem;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.08), rgba(91, 140, 255, 0.02)),
    rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}

[data-theme="dark"] .auth-hero,
[data-theme="dark"] .auth-card {
  border-color: rgba(68, 68, 68, 0.9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .auth-hero {
  background:
    linear-gradient(135deg, rgba(122, 162, 255, 0.14), rgba(122, 162, 255, 0.03)),
    rgba(15, 23, 42, 0.82);
}

.auth-card {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.94);
}

[data-theme="dark"] .auth-card {
  background: rgba(15, 23, 42, 0.94);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.1);
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  max-width: 44rem;
  color: var(--color-secondary);
  font-size: 1rem;
}

.auth-feature-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(222, 226, 230, 0.8);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .auth-feature {
  border-color: rgba(68, 68, 68, 0.85);
  background: rgba(30, 41, 59, 0.75);
}

.auth-feature-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(91, 140, 255, 0.14);
  color: var(--color-accent);
  flex-shrink: 0;
}

.auth-form-header h2 {
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.auth-form-header p {
  color: var(--color-secondary);
  margin-top: 0.35rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-field label {
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-field input {
  height: 3rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.95rem;
}

.auth-note {
  font-size: 0.82rem;
  color: var(--color-secondary);
}

.auth-submit {
  width: 100%;
  height: 3rem;
  border-radius: 0.95rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: 0.92rem;
}

.auth-links-row p {
  color: var(--color-secondary);
}

.auth-top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-secondary);
  font-size: 0.92rem;
}

.auth-status {
  min-height: 1.5rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-light);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .history-item {
  background-color: #222;
}

.history-date {
  font-size: 0.85rem;
  color: var(--color-secondary);
  margin-bottom: 0.35rem;
}

.history-desc {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-amount {
  font-weight: 600;
}

.history-amount.positive {
  color: var(--color-success);
}

.history-amount.negative {
  color: var(--color-danger);
}

/* Utils */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* Mobile adjustments */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .msg {
    max-width: 95%;
  }
  
  .controls {
    flex-direction: column;
  }

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

  .auth-hero {
    padding: 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .auth-links-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
