/* Modern UI Styles for FastAPI Admin Interface */

/* Modern UI Styles for FastAPI Admin Interface – Fixed Alignment + Device Form Support */

:root {
  --primary-color: #4f46e5;
  --accent-color: #6366f1;
  --bg-color: #f9fafb;
  --text-color: #111827;
  --border-color: #d1d5db;
  --error-color: #dc2626;
  --success-color: #16a34a;
  --radius: 8px;
  --font-size: 16px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  font-size: var(--font-size);
}

h1, h2, h3 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

form {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: block;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea,
select {
  padding: 0.65rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
  box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  margin-top: -0.5rem;
}

button {
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
button:hover {
  background-color: var(--accent-color);
}

.section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: white;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 600px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--text-color);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background-color: var(--success-color);
}

.toast.error {
  background-color: var(--error-color);
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }
  form, .section {
    padding: 1.5rem;
  }
}
