/* Base styles - adapted from Receipt Recorder */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Auth-specific container - narrower for forms */
.auth-container {
  max-width: 400px;
  width: 100%;
}

/* Brand header */
.brand {
  text-align: center;
  margin-bottom: 30px;
}

.brand h1 {
  font-size: 32px;
  color: #4285f4;
  margin-bottom: 8px;
}

.brand .subtitle {
  color: #666;
  font-size: 16px;
}

/* Auth form styling */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-field label {
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-field input {
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.form-field input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

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

/* Buttons */
button {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  background: #4285f4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #3367d6;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Status and error messages */
.status {
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  text-align: center;
  font-weight: 500;
}

.status.processing {
  background: #fff3cd;
  color: #856404;
}

.status.success {
  background: #d4edda;
  color: #155724;
}

.error {
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  background: #f8d7da;
  color: #721c24;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Auth links section */
.auth-links {
  margin-top: 25px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.auth-links a {
  color: #4285f4;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Version info */
.version-info {
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: #999;
}

/* Account page styles */
.account-info {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.info-row {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.info-row label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-row span {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
}

.btn-danger:hover:not(:disabled) {
  background: #c82333;
}

.danger-zone {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.danger-zone h3 {
  font-size: 14px;
  color: #dc3545;
  margin-bottom: 15px;
}

.btn-danger-outline {
  background: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
}

.btn-danger-outline:hover:not(:disabled) {
  background: #dc3545;
  color: white;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h2 {
  font-size: 20px;
  color: #333;
  margin-bottom: 20px;
}

.modal p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 15px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-actions button {
  min-width: 100px;
}

.btn-outline {
  background: transparent;
  color: #4285f4;
  border: 1px solid #4285f4;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(66, 133, 244, 0.1);
}

/* 2FA specific styles */
.two-factor-section {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #eee;
}

.two-factor-section h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
}

.two-factor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.status-badge.enabled {
  background: #d4edda;
  color: #155724;
}

.status-badge.disabled {
  background: #f8d7da;
  color: #721c24;
}

.status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-badge.enabled .status-icon {
  background: #28a745;
}

.status-badge.disabled .status-icon {
  background: #dc3545;
}

/* QR code display */
.qr-container {
  text-align: center;
  margin: 20px 0;
}

.qr-container img {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.secret-key {
  margin: 15px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  word-break: break-all;
  text-align: center;
  color: #333;
  border: 1px dashed #ddd;
}

.secret-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

/* TOTP code input - large centered */
.totp-input-container {
  margin: 20px 0;
}

.totp-input {
  width: 100%;
  padding: 15px;
  font-size: 28px;
  font-family: monospace;
  text-align: center;
  letter-spacing: 8px;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.totp-input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

.totp-input::placeholder {
  letter-spacing: normal;
  font-size: 16px;
}

/* Modal steps */
.modal-step {
  display: none;
}

.modal-step.active {
  display: block;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
}

.step-dot.active {
  background: #4285f4;
}

.step-dot.completed {
  background: #28a745;
}

/* Enrollment instructions */
.enrollment-instructions {
  background: #f0f7ff;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.enrollment-instructions ol {
  margin: 0;
  padding-left: 20px;
}

.enrollment-instructions li {
  margin: 8px 0;
  color: #333;
  font-size: 14px;
}

/* MFA challenge modal specific */
.mfa-modal .modal {
  text-align: center;
}

.mfa-modal .auth-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: #f0f7ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.mfa-error {
  color: #dc3545;
  font-size: 13px;
  margin-top: 10px;
}

/* Verification status */
.verification-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* Two-factor not available message */
.twofa-unavailable {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

/* Success message box */
.success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 20px;
  border-radius: 6px;
  text-align: center;
}

.success-message p {
  margin: 8px 0;
}

.success-message p:first-child {
  font-weight: 500;
}
