/* ============================================================
   Alari Charts — Shared Stylesheet
   ============================================================ */

/* ── CSS Variables — Light Mode ───────────────────────────── */
:root {
  --bg-image: url('/assets/img/background_day.jpg');
  --bg-color: #eee;
  --text-color: #555;
  --card-bg: #fff;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --input-border-bottom: #d2d2d2;
  --toggle-bg: #dee2e6;
}

/* ── CSS Variables — Dark Mode ────────────────────────────── */
[data-theme="dark"] {
  --bg-image: none;
  --bg-color: #121212;
  --text-color: #ddd;
  --card-bg: #1e1e2e;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --input-border-bottom: #555;
  --toggle-bg: #495057;
}

/* Auto-detect system dark mode (only if no manual preference set) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-image: none;
    --bg-color: #121212;
    --text-color: #ddd;
    --card-bg: #1e1e2e;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --input-border-bottom: #555;
    --toggle-bg: #495057;
  }
}

/* ── Body ─────────────────────────────────────────────────── */
body {
  background-image: var(--bg-image);
  background-attachment: fixed;
  background-color: var(--bg-color);
  background-repeat: repeat;
  margin: 0;
  padding: 0;
  font-family: Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.5em;
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* ── Page card (white rounded box) ───────────────────────── */
.page-card {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-top: 5px;
  margin-bottom: 5px;
  transition: background 0.3s, box-shadow 0.3s;
}

/* ── Theme toggle button ──────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.6;
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
}
.theme-toggle:hover { opacity: 1; }

/* ── Login page ───────────────────────────────────────────── */
.login-container {
  max-width: 500px;
  width: 100%;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h2 {
  font-size: 28px;
  font-weight: 400;
  color: var(--text-color);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 15px;
  margin: 0;
}

.form-label {
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text-color);
  font-size: 14px;
}

.btn-primary-custom {
  background-color: #4361ee;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 500;
  padding: 13px;
  width: 100%;
  font-size: 15px;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-primary-custom:hover {
  background-color: #3a56d4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
  color: #fff;
}

.divider {
  display: flex;
  align-items: center;
  margin: 25px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.6;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--input-border-bottom);
}

.divider span {
  padding: 0 15px;
  background: var(--card-bg);
}

.login-provider-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background-color: transparent;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 400;
  color: #3c4043;
  text-decoration: none;
  width: 100%;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.login-provider-button:hover {
  background-color: #f8f9fa;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: #3c4043;
}

[data-theme="dark"] .login-provider-button {
  background-color: transparent;
  border: 1px solid #333;
  color: #E3E3E3;
}
[data-theme="dark"] .login-provider-button:hover {
  background-color: #1e1e20;
  color: #E3E3E3;
  box-shadow: 0 4px 8px rgba(0,0,0,.4);
}

.provider-icon {
  font-size: 22px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.provider-icon.fa-google { color: #4285F4; }

.logo-container {
  text-align: center;
  margin-bottom: 20px;
}

[data-theme="dark"] input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="file"]) {
  background-color: transparent !important;
  background-image: none !important;
  color: #ddd !important;
  border: none !important;
  border-bottom: 1px solid #666 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none;
}
[data-theme="dark"] input::placeholder {
  color: #666 !important;
}
[data-theme="dark"] input:focus {
  outline: none !important;
  border-bottom-color: #aaa !important;
  box-shadow: none !important;
}

@media (max-width: 480px) {
  .page-card { padding: 25px; }
  body { padding: 15px; }
}
