/* ReportHub - Login - Claude Style */

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

:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-input: #262626;
  --border: #333;
  --border-light: #2a2a2a;
  --text: #e8e8e8;
  --text-secondary: #888;
  --text-tertiary: #555;
  --accent: #da7756;
  --accent-hover: #c4613f;
  --error-bg: #2a1515;
  --error-border: #822;
  --error-text: #ff6b6b;
  --error-icon: #ff6b6b;
}

/* Reset body to dark mode by default */
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.login-logo span {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.login-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.login-error {
  display: none;
  padding: 10px 12px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 6px;
  margin: 16px 0;
  color: var(--error-text);
  font-size: 13px;
}
.login-error.visible {
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--error-icon);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease;
}
.input-group input::placeholder {
  color: var(--text-tertiary);
}
.input-group input:focus {
  border-color: var(--accent);
}

.input-wrapper {
  position: relative;
}
.input-wrapper .pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
}
.input-wrapper .pw-toggle:hover {
  color: var(--text-secondary);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  transition: all 150ms;
  flex-shrink: 0;
}
.checkbox-wrapper input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-label {
  color: var(--text-secondary);
}

.forgot-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.forgot-link:hover {
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  height: 42px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.btn-login:hover {
  background: var(--accent-hover);
}
.btn-login.loading {
  pointer-events: none;
  opacity: 0.8;
}
.btn-login.loading .btn-text {
  display: none;
}
.btn-login .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-login.loading .btn-spinner {
  display: block;
}

.demo-hint {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-tertiary);
}
.demo-hint strong {
  color: var(--text-secondary);
}

.login-footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-mini {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--text-tertiary);
  background: transparent !important;
  border: none;
  cursor: pointer;
  transition: all 150ms;
}
.theme-toggle-mini:hover {
  opacity: 1;
  background: transparent !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shake {
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}
.login-error.shake {
  animation: shake 0.4s ease;
}

/* Light mode override - can be toggled if needed */
html.light {
  --bg: #fafafa;
  --bg-card: #fff;
  --bg-input: #fafafa;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-tertiary: #999;
}

@media (max-width: 400px) {
  .login-card {
    padding: 24px;
  }
}
