/**
 * InPeer Sovereign Authentication Design System
 * Shared stylesheet for login, register, password recovery, and 2FA verification.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(108, 92, 255, 0.22), transparent 35%),
    radial-gradient(circle at 85% 90%, rgba(161, 124, 255, 0.12), transparent 40%),
    linear-gradient(135deg, #07090e 0%, #030508 100%);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-electron {
  padding-top: 32px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.card {
  width: min(440px, calc(100vw - 28px));
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(14, 19, 29, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(108, 92, 255, 0.15);
}

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

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

p, .subtitle {
  margin: 0 0 24px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: block;
  margin: 14px 0 6px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]) {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  padding: 0 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

input[type="file"] {
  width: 100%;
  padding: 12px;
  height: auto;
  font-size: 13px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  cursor: pointer;
}

input:focus {
  border-color: rgba(108, 92, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(108, 92, 255, 0.25);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #6c5cff;
  cursor: pointer;
  margin: 0;
}

button, .btn-primary {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6c5cff, #8b5cf6);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 750;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(108, 92, 255, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 92, 255, 0.5);
  filter: brightness(1.08);
}

button:active, .btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  width: 100%;
  height: 46px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.error, .alert-danger {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 13.5px;
  line-height: 1.45;
}

.success, .alert-success {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  font-size: 13.5px;
  line-height: 1.45;
}

a {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.foot {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: #94a3b8;
}

.hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Two-factor verification code input */
.twofa-input, input.code-input {
  font-family: 'JetBrains Mono', monospace, monospace !important;
  font-size: 24px !important;
  letter-spacing: 6px !important;
  text-align: center !important;
  height: 56px !important;
}

@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not(.twofa-input):not(.code-input),
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }
  .card {
    padding: 22px 16px;
    border-radius: 18px;
  }
  h1 {
    font-size: 22px;
  }
}

/* ─── Two-Factor Authentication Components (5.1) ───────────────── */
.shield-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(108, 92, 255, 0.25), rgba(0, 240, 255, 0.20));
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  display: grid;
  place-items: center;
  font-size: 26px;
  box-shadow: 0 0 20px rgba(108, 92, 255, 0.35);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a17cff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.input-wrapper input[type="text"] {
  height: 54px;
  border: 1.5px solid rgba(108, 92, 255, 0.35);
  border-radius: 14px;
  background: rgba(8, 11, 19, 0.75);
  color: #00f0ff;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 6px;
}

.input-wrapper input[type="text"]:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.input-wrapper input[type="text"]::placeholder {
  color: #475569;
  letter-spacing: 2px;
  font-size: 14px;
  font-weight: 500;
}

button.submit-btn {
  background: linear-gradient(135deg, #6c5cff 0%, #00d2ff 100%);
  box-shadow: 0 8px 24px rgba(108, 92, 255, 0.4);
}

button.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(108, 92, 255, 0.55);
}

.alt-methods {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.alt-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.alt-link, .alt-btn {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  display: inline;
  box-shadow: none;
  width: auto;
  height: auto;
}

.alt-link:hover, .alt-btn:hover {
  color: #a17cff;
  background: none;
  transform: none;
  box-shadow: none;
  filter: none;
}

.cancel-link {
  margin-top: 14px;
  display: inline-block;
  color: #64748b;
  font-size: 12.5px;
  text-decoration: none;
}

.cancel-link:hover {
  color: #94a3b8;
  text-decoration: underline;
}

.alert.error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 13.5px;
  line-height: 1.45;
}

.alert.success {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  font-size: 13.5px;
  line-height: 1.45;
}
