/* Companies Styles */

/* ─── Help modal base: hidden by default on all pages using this layout ────── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}

.companies-new {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #ffffff;
  min-height: 100vh;
}

/* Header */
header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

.back-link a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: #374151;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00008B;
}

/* Form Section */
.form-section {
  padding: 4rem 0;
  background-color: #f9fafb;
}

.form-container {
  max-width: 500px;
  margin: 0 auto;
  background-color: #ffffff;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.form-headline {
  font-size: 2.5rem;
  font-weight: bold;
  color: #00008B;
  text-align: center;
  margin-bottom: 0.5rem;
}

.form-subheadline {
  font-size: 1.125rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 2rem;
}

/* Form */
.company-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.required-star {
  color: #dc2626;
  font-weight: 600;
  margin-left: 2px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #00008B;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .password-input {
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: color 0.2s ease;
  z-index: 1;
}

.password-toggle-btn:hover {
  color: #374151;
}

.password-toggle-btn:focus {
  outline: none;
  color: #00008B;
}

.password-toggle-btn .eye-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00008B;
}

.checkbox-group label {
  margin: 0;
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Error Messages */
.error-messages {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.error-messages h2 {
  color: #dc2626;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.error-messages ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-messages li {
  color: #dc2626;
  font-size: 0.875rem;
}

/* Form Actions */
.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.submit-btn {
  background-color: #00008B;
  color: #ffffff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-bottom: 1rem;
}

.submit-btn:hover {
  background-color: #00006B;
  transform: translateY(-1px);
}

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

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.inline-actions .btn-secondary {
  margin: 0;
}

.btn-secondary {
  background-color: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease;
  margin-left: 1rem;
}

.btn-secondary:hover {
  border-color: #9ca3af;
  color: #374151;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

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

.account-deletion-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

/* Flash messages */
.flash {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
}
.flash.notice { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.flash.alert { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* Responsive */
/* =============================================================
   MOBILE RESPONSIVE — Companies / Registration Pages
   ============================================================= */
@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  .companies-new {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  /* Header: keep logo + back-link on one row */
  .companies-new .header-content {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  .companies-new .logo {
    font-size: 1.25rem;
  }

  /* Form section */
  .companies-new .form-section {
    padding: 1.5rem 0;
    min-height: calc(100vh - 60px);
  }

  /* Container horizontal padding */
  .companies-new .container {
    padding: 0 1rem;
    box-sizing: border-box;
  }

  /* Form container: full width, centered, visible */
  .companies-new .form-container {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 1.5rem 1.25rem;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    box-sizing: border-box;
  }

  .companies-new .form-headline {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .companies-new .form-subheadline {
    font-size: 1rem;
  }

  /* Form inputs: ensure full width and visible */
  .companies-new .form-group input,
  .companies-new .form-group select {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
  }

  /* Submit button: full width on mobile */
  .companies-new .submit-btn {
    width: 100%;
    display: block;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
  }

  /* Secondary/inline action buttons */
  .companies-new .inline-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .companies-new .inline-actions .btn-secondary,
  .companies-new .btn-secondary {
    width: 100%;
    text-align: center;
    margin-left: 0;
    box-sizing: border-box;
  }

  /* Error messages */
  .companies-new .error-messages {
    margin-bottom: 1rem;
  }
}

@media (max-width: 640px) {
  .companies-new .form-container {
    padding: 1.25rem 0.875rem;
  }

  .companies-new .form-headline {
    font-size: 1.5rem;
  }

  .companies-new .header-content {
    padding: 0.5rem 0;
  }

  .companies-new .back-link {
    align-self: flex-start;
  }
}

@media (min-width: 640px) {
  .companies-new .inline-actions {
    justify-content: space-between;
  }
}
