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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: #fafafa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: #fafafa;
}

.logo svg {
  height: 40px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: none;
}

.lang-selector:hover:not(:disabled) {
  color: #111;
}

.lang-selector:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-signup {
  padding: 8px 16px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
}

.btn-signup:hover:not(.disabled) {
  background-color: #f9fafb;
}

.btn-signup.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 20px 40px;
}

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.card-title {
  font-size: 24px;
  font-weight: 600;
  color: #111;
  margin-bottom: 24px;
}

/* Social Buttons */
.social-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s;
}

.social-btn:hover:not(:disabled) {
  background-color: #f9fafb;
}

.social-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

/* SSO Button */
.sso-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  margin-bottom: 24px;
}

.sso-btn:hover:not(:disabled) {
  background-color: #f9fafb;
}

.sso-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Message */
.form-message {
  display: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.form-message.error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.form-message.info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: #e5e7eb;
}

.divider span {
  padding: 0 16px;
  color: #9ca3af;
  font-size: 14px;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
}

.password-toggle:hover {
  color: #6b7280;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 12px 16px;
  background-color: #2563eb;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 0.15s;
}

.btn-submit:hover {
  background-color: #1d4ed8;
}

/* Links */
.links {
  text-align: center;
  margin-top: 20px;
}

.links p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.links a {
  color: #2563eb;
  text-decoration: none;
}

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

.links a.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
}

.footer a {
  color: #6b7280;
  text-decoration: underline;
}

.footer a:hover {
  color: #374151;
}

.footer a.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Dialog */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.dialog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.dialog-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.dialog-overlay.active .dialog-card {
  transform: scale(1) translateY(0);
}

.dialog-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.dialog-sync-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.dialog-brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dialog-brand-icon.cloudflare {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.dialog-brand-icon.google {
  background: #fff;
  border: 1px solid #e5e7eb;
}

.dialog-sync-arrows {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: syncPulse 2s ease-in-out infinite;
}

.dialog-sync-arrows svg {
  animation: syncRotate 3s linear infinite;
}

@keyframes syncPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes syncRotate {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.dialog-title {
  font-size: 24px;
  font-weight: 600;
  color: #111;
  margin-bottom: 12px;
}

.dialog-description {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 24px;
}

.dialog-features {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}

.dialog-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: #374151;
}

.dialog-feature:not(:last-child) {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.dialog-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.dialog-btn:hover {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dialog-btn:active {
  background-color: #f1f3f4;
}


.dialog-footer {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 16px;
  line-height: 1.5;
}

.dialog-footer a {
  color: #6b7280;
  text-decoration: underline;
}

.dialog-footer a:hover {
  color: #374151;
}

/* Responsive */
@media (max-width: 480px) {
  .card {
    padding: 24px;
  }

  .social-buttons {
    flex-direction: column;
  }

  .header {
    padding: 12px 16px;
  }

  .dialog-card {
    padding: 24px;
  }

  .dialog-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }

  .dialog-icon img {
    width: 36px;
    height: 36px;
  }

  .dialog-sync-icons {
    gap: 12px;
    margin-bottom: 20px;
  }

  .dialog-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .dialog-brand-icon.cloudflare img {
    width: 32px;
    height: 32px;
  }

  .dialog-brand-icon.google img {
    width: 24px;
    height: 24px;
  }

  .dialog-sync-arrows svg {
    width: 20px;
    height: 20px;
  }

  .dialog-title {
    font-size: 20px;
  }

  .dialog-description {
    font-size: 14px;
  }
}
