/* ================================================================
   styles.css — Shared stylesheet for all auth + utility pages:
   LoginPage, TwoFactorLogin, ChangePassword, ForgotPassword,
   HomePage, Setup2FA
   ================================================================ */

/* ─── CSS VARIABLES ─── */
:root {
  --green:        #47AB11;
  --green-dark:   #3a8a0d;
  --green-dim:    rgba(71, 171, 17, 0.12);
  --green-border: rgba(71, 171, 17, 0.3);
  --green-light:  #8fd65a;
  --bg:           #141414;
  --panel:        #1e1e1e;
  --panel2:       #252525;
  --surface:      #2e2e2e;
  --border:       #383838;
  --text:         #e2e2e2;
  --text-muted:   #888;
  --font:         'IBM Plex Sans', sans-serif;
  --mono:         'IBM Plex Mono', monospace;
  --amber:        #f0a500;
  --red:          #d9534f;
  --red-dark:     #c9302c;
  --radius:       14px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── BODY ─── */
body {
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(71, 171, 17, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(71, 171, 17, 0.04) 0%, transparent 50%);
  color: var(--text);
  padding: 20px;
}

/* ================================================================
   BOOTSTRAP OVERRIDES
   ================================================================ */

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* ================================================================
   LOGIN WRAP (LoginPage only)
   ================================================================ */

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 420px;
}

/* ================================================================
   SHARED CARD
   ================================================================ */

.login-card,
.home-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(71, 171, 17, 0.06);
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text);
}

.card { background: transparent; border: none; }

/* ================================================================
   PAGE TITLES
   ================================================================ */

h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0;
}

/* ================================================================
   LOGO
   ================================================================ */

.logo-wrap { text-align: center; }

.logo-wrap img { width: 130px; filter: brightness(0.92); }

/* ================================================================
   HOME PAGE
   ================================================================ */

.home-card { max-width: 420px; text-align: center; }

.home-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}

.home-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-light);
  font-family: var(--mono);
  margin-bottom: 8px;
}

/* ================================================================
   MESSAGE BOX
   ================================================================ */

.message-box-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(240, 165, 0, 0.1);
  border: 1px solid rgba(240, 165, 0, 0.35);
  border-radius: 8px;
  padding: 11px 40px 11px 14px;
  position: relative;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-icon { color: var(--amber); font-size: 15px; flex-shrink: 0; }

.msg-text p,
.message-box-custom p {
  font-size: 13px;
  color: #ddc98a;
  line-height: 1.5;
  margin: 0;
}

.message-box-custom .btn-close {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

.message-box-custom .btn-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ================================================================
   FORM STRUCTURE
   ================================================================ */

.login-form { display: flex; flex-direction: column; gap: 16px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label,
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ================================================================
   INPUT FIELDS
   ================================================================ */

.field-input {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(71, 171, 17, 0.15);
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-wrap: nowrap;
}

.input-group:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(71, 171, 17, 0.15);
}

.field-icon,
.input-group-text {
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel2);
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.form-control {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  min-width: 0;
  border-radius: 0;
  box-shadow: none;
}

.form-control::placeholder { color: #555; }

.form-control:focus {
  background: #333;
  box-shadow: none;
  border-color: transparent;
  color: var(--text);
  outline: none;
}

.input-group .form-control,
.input-group .form-control:focus { border: none; box-shadow: none; }

/* ================================================================
   2FA DIGIT INPUTS
   ================================================================ */

.digit-input {
  width: 44px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-family: var(--mono);
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  margin: 0 4px;
  padding: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.digit-input:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(71, 171, 17, 0.15) !important;
  background: #333;
}

/* ================================================================
   BUTTONS
   ================================================================ */

/* Primary green */
.btn-login,
.btn-success,
.btn.btn-success,
.btn-green,
.btn.btn-green {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: var(--green-dark);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.btn-login:hover,
.btn-success:hover,
.btn.btn-success:hover,
.btn-green:hover,
.btn.btn-green:hover {
  background: var(--green);
  box-shadow: 0 0 16px rgba(71, 171, 17, 0.3);
  color: #fff;
}

/* Destructive red — used by Disable 2FA */
.btn-danger,
.btn.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: var(--red);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.btn-danger:hover,
.btn.btn-danger:hover {
  background: var(--red-dark);
  box-shadow: 0 0 16px rgba(217, 83, 79, 0.3);
  color: #fff;
}

/* Home page nav buttons */
.button-group .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--green-dark);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.button-group .btn:hover {
  background: var(--green);
  box-shadow: 0 0 12px rgba(71, 171, 17, 0.25);
  color: #fff;
}

/* Secondary ghost */
.btn-secondary-action,
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px;
  background: var(--panel2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-secondary-action:hover,
.btn-secondary:hover {
  border-color: var(--green-border);
  color: var(--green-light);
  background: var(--green-dim);
}

/* Link style */
.btn-link-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
  font-family: var(--font);
}

.btn-link-custom:hover { color: var(--green); text-decoration: none; }

/* ================================================================
   SECONDARY ACTIONS BLOCK
   ================================================================ */

.secondary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

/* ================================================================
   SPACING HELPERS
   ================================================================ */

.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

/* ================================================================
   FOOTER NOTE
   ================================================================ */

.footer-note {
  font-size: 10.5px;
  color: #444;
  text-align: center;
  line-height: 1.5;
  max-width: 340px;
}

/* ================================================================
   SCROLLBAR
   ================================================================ */

*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 6px; }

/* ================================================================
   RESPONSIVE  (≤ 480px)
   ================================================================ */

@media (max-width: 480px) {
  .login-card,
  .home-card { padding: 24px 18px 22px; border-radius: 12px; }

  .form-control { font-size: 16px; }

  .digit-input { width: 38px; height: 48px; font-size: 1.2rem; margin: 0 2px; }
}