/* ========================================
   Sponsor (Server Provider) - Page-specific Styles
   ======================================== */

/* === Page Main Container === */
.sponsor-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* === Hero Banner === */
.sponsor-hero {
  text-align: center;
  padding: 52px 40px 44px;
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(circle at top right, rgba(82,196,26,0.06), transparent 40%),
    radial-gradient(circle at bottom left, rgba(26,176,196,0.04), transparent 40%);
}

.sponsor-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(82, 196, 26, 0.05);
  pointer-events: none;
}

.sponsor-hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(26, 176, 196, 0.04);
  pointer-events: none;
}

.sponsor-hero-icon {
  font-size: 48px;
  margin-bottom: 18px;
  display: block;
}

.sponsor-hero h1 {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  color: var(--text-color);
}

.sponsor-hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 800px;
}

/* Sponsor management dashboard entry */
.sponsor-admin-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid rgba(128, 128, 128, 0.15);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}
.sponsor-admin-entry:hover {
  color: var(--primary-color);
  background: rgba(82, 196, 26, 0.1);
  border-color: rgba(82, 196, 26, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.12);
}
.sponsor-admin-entry svg {
  flex-shrink: 0;
}

/* === Section Titles === */
.sponsor-section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-color);
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}

.sponsor-section-subtitle {
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 36px;
}

/* === Server Requirements Alert Box === */
.sponsor-requirements {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.sponsor-requirements::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent));
}

.req-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.req-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.req-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.req-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--hover-bg);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.req-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.req-item-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.req-item-text strong {
  color: var(--text-color);
  font-weight: 600;
}

.req-notices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 165, 0, 0.06);
  border: 1px solid rgba(255, 165, 0, 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.req-notice strong {
  color: var(--warning-color, #FFA500);
}

.req-notice-safe {
  background: rgba(82, 196, 26, 0.05);
  border-color: rgba(82, 196, 26, 0.2);
}

.req-notice-safe strong {
  color: var(--primary-color);
}

.req-notice-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* === Agent Installation Command Section === */
.agent-cmd-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 40px;
}

.agent-cmd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.agent-cmd-icon {
  font-size: 24px;
}

.agent-cmd-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
}

.agent-cmd-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.cmd-block {
  position: relative;
  background: #1e1e2e;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  overflow-x: auto;
}

:root.dark-mode .cmd-block {
  background: #0d0d1a;
  border: 1px solid #262640;
}

.cmd-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cmd-block-label {
  font-size: 12px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cmd-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #aaa;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.cmd-copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cmd-copy-btn.copied {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.cmd-text {
  font-family: 'Roboto Mono', 'Fira Code', monospace;
  font-size: 14px;
  color: #cdd6f4;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.cmd-text .cmd-comment {
  color: #6c7086;
}

.cmd-text .cmd-highlight {
  color: #a6e3a1;
}

.cmd-text .cmd-variable {
  color: #f9e2af;
}

.cmd-hint {
  font-size: 12px;
  color: var(--text-tertiary, #999);
  margin-top: 8px;
  line-height: 1.5;
}

/* === Application Form Section === */
.sponsor-form-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 44px 56px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.sponsor-form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .required {
  color: var(--error-color, #dc3545);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 10px;
  transition: all 0.3s var(--ease-out);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.12);
  outline: none;
}

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

.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary, #999);
  margin-top: 6px;
  line-height: 1.5;
}

/* === Dynamic Server List === */
.server-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.server-card {
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  transition: all 0.3s var(--ease-out);
  animation: slideDown 0.3s var(--ease-out);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.server-card:hover {
  border-color: rgba(82, 196, 26, 0.3);
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.server-card-index {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-card-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.server-card-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
}

.server-remove-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.server-remove-btn:hover {
  border-color: var(--error-color, #dc3545);
  color: var(--error-color, #dc3545);
  background: rgba(220, 53, 69, 0.05);
}

.server-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.server-fields .form-group {
  min-width: 0;
}

/* IPv6 Toggle */
.ipv6-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.ipv6-toggle:hover {
  border-color: var(--primary-color);
}

.ipv6-toggle.active {
  border-color: var(--primary-color);
  background: rgba(82, 196, 26, 0.05);
}

.toggle-switch {
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.ipv6-toggle.active .toggle-switch {
  background: var(--primary-color);
}

.toggle-switch::after {
  content: '';
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ipv6-toggle.active .toggle-switch::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.ipv6-toggle.active .toggle-label {
  color: var(--primary-color);
  font-weight: 600;
}

/* Add Server Button */
.add-server-btn {
  width: 100%;
  height: 52px;
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s var(--ease-out);
}

.add-server-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(82, 196, 26, 0.03);
}

.add-server-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.server-count-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary, #999);
  margin-top: 10px;
}

/* === Agent Installation Confirmation === */
.agent-installed-confirm {
  margin-top: 32px;
  padding: 24px 28px;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.confirm-checkbox {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.confirm-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 24px;
  height: 24px;
  border: 2px solid var(--input-border);
  border-radius: 7px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.25s var(--ease-out);
  background: var(--input-bg);
}

.confirm-checkbox:hover .checkbox-custom {
  border-color: var(--primary-color);
}

.confirm-checkbox input:checked + .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.confirm-checkbox input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.confirm-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.4;
}

.confirm-hint {
  margin: 10px 0 0 38px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Error State */
.confirm-checkbox.error .checkbox-custom {
  border-color: var(--error-color, #dc3545);
  animation: shake 0.4s ease;
}

.confirm-checkbox.error .confirm-text {
  color: var(--error-color, #dc3545);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

/* === Submit Button === */
.form-submit-area {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-submit {
  min-width: 220px;
  height: 52px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.form-submit-hint {
  font-size: 13px;
  color: var(--text-tertiary, #999);
}

/* === FAQ Section === */
.sponsor-faq {
  margin-bottom: 40px;
}

.faq-list {
  max-width: 100%;
  margin: 0 auto;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
}

.faq-item:hover {
  border-color: rgba(82, 196, 26, 0.3);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--primary-color);
}

.faq-arrow {
  font-size: 12px;
  transition: transform 0.3s var(--ease-out);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out), padding 0.35s var(--ease-out);
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* === Contact Section Footer === */
.sponsor-contact {
  text-align: center;
  padding: 44px 40px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 40px;
}

.sponsor-contact-icon {
  font-size: 40px;
  margin-bottom: 14px;
  display: block;
}

.sponsor-contact h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 8px;
}

.sponsor-contact p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.6;
}

.sponsor-contact .contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  padding: 12px 28px;
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  transition: all 0.3s var(--ease-out);
}

.sponsor-contact .contact-email:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(82, 196, 26, 0.25);
}

/* === Form Validation State === */
.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
  border-color: var(--error-color, #dc3545);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-error-msg {
  font-size: 12px;
  color: var(--error-color, #dc3545);
  margin-top: 6px;
  display: none;
}

.form-group.error .form-error-msg {
  display: block;
}

/* === Submit Success Animation === */
.submit-success-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  text-align: center;
  padding: 40px;
}

.submit-success-overlay.show {
  display: flex;
  animation: fadeInUp 0.5s var(--ease-out);
}

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

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(82, 196, 26, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 12px;
}

.success-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 420px;
}

/* === Divider === */
.form-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.form-section-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
  margin-top: 4px;
}

.form-section-label span {
  font-size: 20px;
}

/* === Responsive Adaptation === */

/* Large screen: >=1400px */
@media (min-width: 1400px) {
  .sponsor-page {
    max-width: 1400px;
  }

  .server-fields {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Medium screen: 768px ~ 1399px */
@media (min-width: 769px) and (max-width: 1399px) {
  .server-fields {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: <=768px */
@media (max-width: 768px) {
  .sponsor-page {
    padding: 24px 16px 40px;
  }

  .sponsor-hero {
    padding: 36px 20px 32px;
    border-radius: 16px;
    margin-bottom: 28px;
  }

  .sponsor-hero h1 {
    font-size: 24px;
  }

  .sponsor-hero-desc {
    font-size: 14px;
  }

  .sponsor-requirements {
    padding: 20px;
  }

  .req-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .agent-cmd-section {
    padding: 20px;
  }

  .cmd-block {
    padding: 16px;
  }

  .cmd-text {
    font-size: 12px;
  }

  .sponsor-form-section {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .server-fields {
    grid-template-columns: 1fr;
  }

  .form-submit-area {
    flex-direction: column;
  }

  .btn-submit {
    width: 100%;
  }

  .sponsor-section-title {
    font-size: 22px;
  }

  .sponsor-contact {
    padding: 32px 20px;
  }
}

/* === Dark Mode Optimization === */
:root.dark-mode .server-card {
  background: #1a1a1a;
}

:root.dark-mode .submit-success-overlay {
  background: var(--card-bg);
}

:root.dark-mode .req-item {
  background: #1a1a1a;
}
