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

:root {
  --primary-color: #7f56da;
  --primary-glow: rgba(127, 86, 218, 0.4);
  --text-color: #ffffff;
  --secondary-text-color: #a0a0a0;
  --font-family-body: "Poppins", sans-serif;
  --background-color: #05050e;
  --surface-color: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --glass-border: 1px solid rgba(255, 255, 255, 0.06);
  --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
  font-family: var(--font-family-body);
  background-color: var(--background-color);
  background-image:
    radial-gradient(
      circle at 10% 20%,
      rgba(127, 86, 218, 0.15) 0%,
      transparent 20%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(51, 181, 229, 0.1) 0%,
      transparent 20%
    );
  color: var(--text-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 6vw, 80px);
  z-index: 1000;
  background: rgba(5, 5, 14, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: var(--glass-border);
}

.header-logo a {
  display: flex;
  align-items: center;
}

.header-logo a img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(127, 86, 218, 0.5));
}

header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 16px;
}

header nav ul li a {
  color: var(--secondary-text-color);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 800;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: var(--glass-border);
}

header nav ul li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.15);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 40px;
}

/* Error/Terms Card */
.error-card,
.terms-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  border: var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  max-width: 800px; /* Horizontal Layout */
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  overflow: hidden;
  animation: fadeIn 0.6s ease;
}

.error-visual,
.terms-visual {
  flex: 0.8;
  background: rgba(127, 86, 218, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-right: var(--glass-border);
}

.error-content,
.terms-content {
  flex: 1.2;
  padding: 50px;
  text-align: left;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Icon Container */
.error-icon-container,
.terms-icon-container {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: rgba(127, 86, 218, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.error-icon-container i,
.terms-icon-container i {
  font-size: 5rem;
  color: var(--primary-color);
}

/* Titles */
.error-message,
.error-title,
.terms-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-color);
}

.error-description,
.terms-description {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--secondary-text-color);
  margin: 0 0 40px 0;
  line-height: 1.6;
}

/* Action Buttons */
.error-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font-family-body);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  flex-shrink: 0;
}

.btn-primary:hover {
  background: var(--primary-glow);
}

.links-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary-text-color);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.link-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: var(--glass-border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.link-card:hover {
  border-color: var(--primary-color);
}

.link-card i {
  font-size: 2rem;
  color: var(--primary-color);
}

/* Terms Summary Items */
.terms-summary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 40px 0;
  text-align: left;
}

.summary-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: var(--glass-border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.summary-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(127, 86, 218, 0.3);
}

.summary-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(127, 86, 218, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-icon i {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.summary-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--text-color);
}

.summary-content p {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--secondary-text-color);
  margin-top: 10px;
}

/* Action Row */
.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  flex-wrap: nowrap;
}

.action-row > * {
  margin: 0;
  flex-shrink: 0;
}

/* Quick Links */
.quick-links {
  display: inline-flex;
  gap: 16px;
  align-items: center;
}

.quick-link {
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.03);
  border: var(--glass-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--secondary-text-color);
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.quick-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Footer - Exact Copy from signin.css */
footer {
  padding: 40px 20px;
  text-align: center;
  margin-top: auto;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.06);
  margin-bottom: 25px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-copyright {
  color: var(--secondary-text-color);
  font-size: 1rem;
  font-weight: 400;
}

.footer-legal-links {
  display: flex;
  gap: clamp(12px, 3vw, 20px);
}

.footer-legal-links a {
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  font-weight: 800;
  color: var(--secondary-text-color);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-legal-links a:hover {
  color: var(--text-color);
}

@media (max-width: 768px) {
  .error-card,
  .terms-card {
    flex-direction: column;
    max-width: 450px;
  }
  .error-visual,
  .terms-visual {
    border-right: none;
    border-bottom: var(--glass-border);
  }
  .error-content,
  .terms-content {
    padding: 30px 20px;
  }
  .error-actions {
    justify-content: center;
  }

  .terms-summary {
    gap: 16px;
    margin: 30px 0;
  }

  .summary-item {
    padding: 20px;
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    line-height: 1.6;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-copyright {
    order: 2;
  }

  .footer-legal-links {
    order: 1;
  }
}

@media (max-width: 480px) {
  .action-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .action-row .btn-primary,
  .action-row .quick-link {
    width: 100%;
    justify-content: center;
  }

  .quick-links {
    flex-direction: column;
    width: 100%;
  }
}
