/* ==========================================================================
   Eter Self-Destruct Portal — Design System
   Replicates the Eter WordPress theme (eter-site) visual language.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --bg-base: #0F0E0D;
  --bg-elevated: #191514;
  --bg-surface: rgba(232, 226, 216, 0.03);
  --bg-surface-hover: rgba(232, 226, 216, 0.06);
  --border-subtle: rgba(232, 226, 216, 0.06);
  --border-default: rgba(232, 226, 216, 0.1);
  --border-strong: rgba(232, 226, 216, 0.16);
  --text-primary: #E8E2D8;
  --text-secondary: #7A6E62;
  --text-tertiary: #5A5048;
  --primary: #C9A96E;
  --primary-strong: #B89A5F;
  --accent: #C9A96E;
  --accent-soft: rgba(201, 169, 110, 0.1);
  --accent-glow: rgba(201, 169, 110, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   1. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 169, 110, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(201, 169, 110, 0.02) 0%, transparent 50%);
  font-family: 'Sora', sans-serif;
  color: var(--text-primary);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   2. Layout
   -------------------------------------------------------------------------- */
.portal-container {
  width: min(800px, calc(100% - 40px));
  margin: 0 auto;
}

.portal-main {
  min-height: calc(100vh - 140px);
  padding: 40px 0;
}

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 14, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}

.portal-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.portal-logo {
  width: 40px;
  height: 40px;
}

.portal-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.portal-back-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--transition-base);
}

.portal-back-link:hover {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */
.portal-hero {
  text-align: center;
  padding: 60px 0 40px;
  animation: fadeIn 0.6s var(--ease-out);
}

.portal-hero-icon {
  margin-bottom: 24px;
}

.portal-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  margin-top: 0;
}

.portal-highlight {
  color: var(--primary);
}

.portal-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   5. Cards (Glassmorphism)
   -------------------------------------------------------------------------- */
.portal-card {
  background: rgba(232, 226, 216, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 40px;
}

.portal-glass {
  box-shadow:
    0 4px 24px rgba(201, 169, 110, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

.portal-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 0;
}

.portal-card-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   6. Form Elements
   -------------------------------------------------------------------------- */
.portal-field {
  margin-bottom: 20px;
}

.portal-field label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(232, 226, 216, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  transition: border-color var(--transition-base);
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.portal-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.portal-btn-primary {
  background: var(--primary);
  color: #0F0E0D;
}

.portal-btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

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

.portal-btn-danger {
  background: #dc2626;
  color: #ffffff;
}

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

.portal-btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.portal-btn-danger:active:not(:disabled) {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   8. Error Message
   -------------------------------------------------------------------------- */
.portal-error {
  color: #ef4444;
  font-size: 0.875rem;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --------------------------------------------------------------------------
   9. Destruction Panel
   -------------------------------------------------------------------------- */
.portal-card-danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.portal-danger-icon {
  text-align: center;
  margin-bottom: 16px;
}

.portal-text-danger {
  color: #ef4444;
}

.portal-destroy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.portal-destroy-list li {
  padding: 10px 0 10px 28px;
  position: relative;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.portal-destroy-list li::before {
  content: "\2715";
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: 700;
}

.portal-confirm-box {
  margin: 24px 0;
  padding: 20px;
  background: rgba(239, 68, 68, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.portal-confirm-box label {
  margin-bottom: 10px;
}

.portal-confirm-box strong {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   10. Success Panel
   -------------------------------------------------------------------------- */
.portal-card-success {
  border-color: rgba(34, 197, 94, 0.2);
}

.portal-success-icon {
  text-align: center;
  margin-bottom: 16px;
}

.portal-text-success {
  color: #22c55e;
}

.portal-text-muted {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   11. Spinner
   -------------------------------------------------------------------------- */
.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-spinner {
  display: flex;
  align-items: center;
}

.btn-spinner[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.portal-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  margin-top: 60px;
}

.portal-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  gap: 20px;
}

.portal-footer-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.portal-footer-tagline {
  color: var(--text-secondary);
}

.portal-footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.portal-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.portal-footer-links a:hover {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   13. Legal Pages
   -------------------------------------------------------------------------- */
.legal-main {
  min-height: calc(100vh - 140px);
  padding: 48px 0;
}

.legal-page-header {
  margin-bottom: 24px;
}

.legal-title {
  margin: 10px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--border-default);
  color: var(--primary);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.legal-updated {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.legal-card {
  background: rgba(232, 226, 216, 0.03);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.legal-lang-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legal-lang-link {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  transition: border-color var(--transition-base), color var(--transition-base);
}

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

.legal-section {
  margin-bottom: 28px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.legal-section p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.legal-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
}

.legal-list li {
  margin-bottom: 6px;
}

.legal-table {
  width: 100%;
  margin: 12px 0 18px;
  border-collapse: collapse;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  vertical-align: top;
}

.legal-table th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
}

.legal-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 720px) {
  .legal-table {
    font-size: 0.85rem;
  }
  .legal-table th,
  .legal-table td {
    padding: 6px 8px;
  }
}

.legal-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: rgba(201, 169, 110, 0.06);
  color: var(--text-secondary);
}

.legal-back-link {
  margin-top: 22px;
}

.legal-back-link a {
  color: var(--primary);
  text-decoration: none;
}

.legal-back-link a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   14. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-section {
  animation: fadeIn 0.5s var(--ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.3s ease;
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .portal-card {
    padding: 24px 20px;
  }

  .portal-hero {
    padding: 40px 0 24px;
  }

  .portal-footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .portal-footer-meta,
  .portal-footer-links {
    justify-content: center;
  }

  .portal-header-inner {
    padding: 0 4px;
  }

  .legal-card {
    padding: 22px 18px;
  }
}
