/*
  File: public/CSS/base.css
  Base globale OTS
  Thème contrôlé par JS (light / dark / system résolu)
*/

/* =========================================================
   VARIABLES COMMUNES
   ========================================================= */

:root {
  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Primary — Light Able exact */
  --primary: #4680ff;
  --primary-hover: #2f6fed;

  --danger: #ff4d4f;
  --success: #2ed573;
  --warning: #ffa502;

  /* Font */
  --font-main: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue",
    Arial, sans-serif;
}

/* =========================================================
   LIGHT THEME — LIGHT ABLE (FIXED)
   ========================================================= */

:root[data-theme="light"] {
  --bg-main: #f4f7fa;
  --bg-card: #ffffff;
  --bg-card-alt: #eef2f7;

  --border-color: #e4e9f2;

  --text-main: #222b45;
  --text-muted: #6b7280;

  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.06);
}

/* =========================================================
   DARK THEME — INCHANGÉ
   ========================================================= */

:root[data-theme="dark"] {
  --bg-main: #0f1419;
  --bg-card: #161c23;
  --bg-card-alt: #1d242c;

  --border-color: #242c36;

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   RESET / BASE
   ========================================================= */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
}

p {
  margin: 0;
  color: var(--text-main);
}

small {
  color: var(--text-muted);
}

/* =========================================================
   LINKS (GLOBAL — SANS SOULIGNEMENT)
   ========================================================= */

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: var(--primary);
}

/* =========================================================
   INPUTS
   ========================================================= */

input,
select,
textarea {
  width: 100%;
  font-family: var(--font-main);
  font-size: 14px;

  background-color: var(--bg-card-alt);
  color: var(--text-main);

  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);

  padding: 12px 14px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

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

/* =========================================================
   BUTTONS
   ========================================================= */

button {
  font-family: var(--font-main);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;

  padding: 10px 16px;
  font-size: 14px;

  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

/* =========================================================
   UTILITIES
   ========================================================= */

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success);
}

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

/* =========================================================
   FORMS
   ========================================================= */

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input,
select,
textarea {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-main);
}

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

input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================
   BUTTONS (GLOBAL)
   ========================================================= */

button {
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  padding: 6px 10px;
  background: var(--bg-card-alt);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

/* =========================================================
   FEEDBACK TEXT
   ========================================================= */

.error {
  color: var(--danger);
  font-size: 14px;
}

.success {
  color: var(--success);
  font-size: 14px;
}

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