/* ==========================================================================
   Components -- Shared UI components for Tilde Energy Trading website
   ========================================================================== */


/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-4) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color var(--duration-normal) var(--ease-out);
}

/* Glass background on a pseudo-element so the navbar itself doesn't
   establish a containing block for its fixed-positioned descendants
   (the mobile .nav-menu overlay uses position: fixed; inset: 0). */
.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background var(--duration-normal) var(--ease-out);
  z-index: -1;
}

.navbar.scrolled {
  border-bottom-color: var(--color-border);
}

.navbar.scrolled::before {
  background: rgba(10, 10, 10, 0.45);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Logo --- */

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.logo-image {
  height: 100px;
  width: auto;
}

/* --- Menu --- */

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: var(--tracking-wide);
  padding: var(--space-2) 0;
  position: relative;
  transition: color var(--duration-normal) var(--ease-out);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-text);
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link.active {
  color: var(--color-text);
}

.nav-link.active::after {
  width: 100%;
}

/* --- Mobile toggle --- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  /* Stay clickable above the full-screen .nav-menu overlay so the X
     icon can close the menu. */
  position: relative;
  z-index: calc(var(--z-overlay) + 1);
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: var(--radius-full);
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile responsive --- */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-8);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) var(--ease-out),
                visibility var(--duration-normal) var(--ease-out);
  }

  .nav-menu.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: var(--text-xl);
  }
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 2rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-out);
}

.btn--primary {
  background: var(--gradient-accent);
  color: #0a0a0a;
  box-shadow: 0 4px 20px rgba(0, 170, 255, 0.2);
}

.btn--primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 30px rgba(0, 170, 255, 0.35);
}

.btn--outline {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

@media (max-width: 768px) {
  .btn {
    padding: 0.65rem 1.5rem;
    font-size: var(--text-xs);
  }
}


/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0%, rgba(0, 170, 255, 0.04) 100%);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 -1px 0 rgba(0, 170, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.25);
  transition: transform var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              background var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(0, 170, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 170, 255, 0.1) 100%);
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 -1px 0 rgba(0, 170, 255, 0.08) inset,
    0 12px 40px rgba(0, 0, 0, 0.35),
    var(--shadow-glow-md);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.card__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}


/* ==========================================================================
   Section headers
   ========================================================================== */

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-16);
}

.section-title {
  font-size: var(--text-4xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}


/* ==========================================================================
   Stats
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.stat {
  text-align: center;
}

.stat__value {
  font-size: var(--text-4xl);
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-2);
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .stat__value {
    font-size: var(--text-3xl);
  }
}


/* ==========================================================================
   Team cards
   ========================================================================== */

.team-member {
  text-align: center;
}

.team-member__photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto var(--space-5);
  filter: grayscale(20%);
  transition: filter var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.team-member__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-member__photo:hover {
  filter: grayscale(0);
  transform: scale(1.03);
}

.team-member__avatar {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-full);
  background: var(--gradient-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.team-member__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.team-member__role {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-3);
}

.team-member__bio {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-top: var(--space-3);
}

.team-member__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.team-member__tag {
  font-size: var(--text-xs);
  color: var(--color-accent);
  background: var(--color-accent-dim);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}


/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 170, 255, 0.12);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.footer__company-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
}

.footer__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.footer__link {
  color: var(--color-text-muted);
  transition: color var(--duration-normal) var(--ease-out);
}

.footer__link:hover {
  color: var(--color-accent);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-6);
  text-align: center;
}


/* ==========================================================================
   Perk cards
   ========================================================================== */

.perk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-16);
}

.perk {
  background: var(--color-bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--duration-normal) var(--ease-out);
}

.perk:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-sm);
}

.perk__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-3);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.perk__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

@media (max-width: 1024px) {
  .perk-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .perk-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   Form elements
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow-sm);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-dim);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b0b0b0' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form-label__hint {
  font-weight: var(--weight-normal);
  color: var(--color-text-dim);
  margin-left: var(--space-2);
}

/* --- Custom file input --- */
/* Hides the native <input type="file"> (which renders with browser-locale
   text like "Choose file" / "Vælg fil") and builds our own consistent
   English-labelled button + filename display. */
.file-input {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.file-input:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow-sm);
}

.file-input__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-input__button {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent-dim);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.file-input__button:hover {
  background: rgba(0, 170, 255, 0.25);
  border-color: var(--color-border-hover);
}

.file-input__native:focus-visible + .file-input__button,
.file-input__button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.file-input__filename {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-input__filename.has-file {
  color: var(--color-text);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}

.form-submit {
  margin-top: var(--space-4);
}

/* --- Conditional career fields reveal --- */
.career-fields {
  margin-top: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-1);
  background: rgba(0, 170, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  animation: career-fields-reveal 0.25s var(--ease-out);
}

.career-fields[hidden] {
  display: none;
}

@keyframes career-fields-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .form-submit {
    width: 100%;
  }
}
