/* shared/styles/auth.css */
/* Authentication pages styles */

/* Reset default margins for auth pages */
html body {
  margin: 0;
  padding: 0;
  width: 100%;
}

body.auth-page {
  background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
}

body.auth-page #app-root,
body.auth-page #view-container {
  background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  width: 100%;
  flex: 1 0 auto;
  margin: 0;
  padding: 24px 16px 40px;
  background: transparent;
  box-sizing: border-box;
}

.auth-box {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: #2C3E50;
  text-align: center;
  margin: 0 0 8px 0;
}

.auth-subtitle {
  color: #666;
  text-align: center;
  margin: 0 0 32px 0;
  font-size: 14px;
}

/* Google Login Button */
.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  margin-bottom: 24px;
}

.google-login-btn:hover {
  background-color: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 20px 0;
  color: #666;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #ddd;
}

.auth-divider::before {
  margin-right: 12px;
}

.auth-divider::after {
  margin-left: 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2C3E50;
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-group input::placeholder {
  color: #aaa;
}

.form-group select {
  background-color: white;
  cursor: pointer;
}

.auth-inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.auth-inline-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding-right: 16px;
}

.auth-inline-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(44, 62, 80, 0.12);
  border-radius: 8px;
  background: #f7fafc;
  color: #355066;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.auth-inline-action:hover {
  border-color: rgba(44, 62, 80, 0.2);
  background: #f1f6fa;
  color: #243746;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.06);
}

.auth-inline-action:disabled {
  cursor: default;
  box-shadow: none;
}

.auth-inline-message {
  margin: 4px 2px 0;
  color: #6b7c89;
  font-size: 12px;
  line-height: 1.45;
}

.auth-inline-field[data-state="sending"] .auth-inline-action {
  border-color: #c7d6e3;
  background: #edf4fa;
  color: #476173;
}

.auth-inline-field[data-state="sent"] input {
  border-color: #bed8c8;
  background: #f7fcf9;
}

.auth-inline-field[data-state="sent"] .auth-inline-action {
  border-color: rgba(74, 129, 107, 0.22);
  background: #eef8f2;
  color: #2d6e52;
}

.auth-inline-field[data-state="verified"] input {
  border-color: #8bc8a9;
  background: #f4fbf7;
  box-shadow: 0 0 0 3px rgba(59, 130, 96, 0.08);
}

.auth-inline-field[data-state="verified"] .auth-inline-action {
  border-color: rgba(32, 129, 89, 0.18);
  background: #ebf7f0;
  color: #1d7d59;
}

.auth-inline-field[data-state="error"] input {
  border-color: #e1b4ae;
  background: #fff8f7;
}

.auth-inline-field[data-state="error"] .auth-inline-action {
  border-color: rgba(193, 64, 47, 0.16);
  background: #fdf1ef;
  color: #9f3a2d;
}

.auth-inline-message[data-state="verified"],
.auth-inline-message[data-state="sent"] {
  color: #2e6a51;
}

.auth-inline-message[data-state="error"] {
  color: #9f3a2d;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.auth-checkbox input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auth-inline-link {
  color: #2C3E50;
  text-decoration: none;
  font-weight: 600;
}

.auth-inline-link:hover {
  text-decoration: underline;
}

.auth-meta-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -10px;
  margin-bottom: -2px;
}

.auth-meta-row .auth-inline-link {
  color: #8a94a3;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.auth-meta-row .auth-inline-link:hover {
  color: #5f6b7a;
  text-decoration: underline;
}

.btn-primary {
  padding: 14px 24px;
  background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(44, 62, 80, 0.4);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

.success-message,
.error-message {
  display: none;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
}

.success-message.show,
.error-message.show {
  display: block;
}

.success-message {
  background: #eef8f2;
  color: #2d6e52;
  border: 1px solid rgba(74, 129, 107, 0.22);
}

.error-message {
  background: #fdf1ef;
  color: #9f3a2d;
  border: 1px solid rgba(193, 64, 47, 0.16);
}

.auth-legal-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}

.auth-link {
  color: #2C3E50;
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
}

.auth-link:hover {
  text-decoration: underline;
}

.error-message {
  padding: 12px 16px;
  background: #fee;
  color: #c33;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  padding: 12px 16px;
  background: #efe;
  color: #3c3;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.success-message.show {
  display: block;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.legal-page {
  width: 100%;
  min-height: calc(100vh - 56px);
  padding: 48px 16px 96px;
  background: #f8fafc;
  box-sizing: border-box;
}

.legal-shell {
  max-width: 780px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.legal-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 12px;
}

.legal-shell h1 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 34px;
}

.legal-updated {
  margin: 0 0 28px;
  color: #64748b;
}

.legal-section + .legal-section {
  margin-top: 28px;
}

.legal-section h2 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #111827;
}

.legal-section p {
  margin: 0;
  color: #4b5563;
  line-height: 1.7;
}

.legal-section p + p {
  margin-top: 12px;
}

.legal-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #4b5563;
  line-height: 1.7;
}

.legal-subtitle {
  margin: 18px 0 8px;
  font-size: 16px;
  color: #1f2937;
}

body.auth-page .app-legal-footer {
  background: linear-gradient(135deg, #2C3E50 0%, #34495e 100%);
  border-top-color: rgba(255, 255, 255, 0.12);
}

body.show-app-footer #view-container:has(.legal-page) {
  background: #f8fafc;
}

body.show-app-footer #view-container:has(.legal-page) + .app-legal-footer {
  background: #f8fafc;
  border-top-color: #f8fafc;
}

body.auth-page .app-legal-footer__inner {
  color: rgba(255, 255, 255, 0.78);
}

body.auth-page .app-legal-footer__inner a {
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 768px) and (max-width: 1279px) {
  .auth-container {
    padding: 32px 20px 40px;
  }

  .auth-box {
    max-width: 402px;
  }
}

@media (max-width: 767px) {
  .auth-box {
    padding: 28px 22px;
  }

  .auth-inline-field {
    display: flex;
  }

  .auth-inline-action {
    flex: 0 0 auto;
  }
}
