/* Shared download form modal (Applications + Dev Hub) */

.download-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.download-modal-overlay[hidden] {
  display: none !important;
}

.download-modal {
  position: relative;
  background: #111;
  border: 1px solid var(--border-color, #222222);
  border-radius: var(--radius-lg, 8px);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.download-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted, #666666);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.download-modal-close:hover {
  color: var(--text-primary, #f0f0f0);
  background: rgba(255, 255, 255, 0.06);
}

.download-modal-close svg {
  width: 20px;
  height: 20px;
}

.download-modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.download-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 194, 222, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #00c2de);
  margin-bottom: 16px;
}

.download-modal-icon svg {
  width: 22px;
  height: 22px;
}

.download-modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #f0f0f0);
  margin-bottom: 6px;
}

.download-modal-header p {
  font-size: 14px;
  color: var(--text-secondary, #999999);
}

.download-modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.download-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.download-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.download-form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #999999);
}

.download-form-field label .required {
  color: #e74c3c;
}

.download-form-field input,
.download-form-field select,
.download-form-field textarea {
  background: #0a0a0a;
  border: 1px solid var(--border-color, #222222);
  border-radius: var(--radius-sm, 4px);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary, #f0f0f0);
  transition: border-color 0.2s;
  width: 100%;
}

.download-form-field input:focus,
.download-form-field select:focus,
.download-form-field textarea:focus {
  outline: none;
  border-color: var(--accent, #00c2de);
}

.download-form-field input::placeholder,
.download-form-field textarea::placeholder {
  color: var(--text-muted, #666666);
}

.download-form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.download-form-field select option {
  background: #111;
  color: var(--text-primary, #f0f0f0);
}

.download-form-other-input {
  margin-top: 8px;
}

.download-form-field textarea {
  resize: vertical;
  min-height: 72px;
}

.download-form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 24px;
  margin-top: 4px;
  background: var(--accent, #00c2de);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: opacity 0.2s;
}

.download-form-submit:hover {
  opacity: 0.9;
}

.download-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.download-form-submit svg {
  width: 18px;
  height: 18px;
}

.download-form-declaration {
  margin-top: 4px;
}

.download-declaration-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary, #999999);
  line-height: 1.5;
  cursor: pointer;
}

.download-declaration-label input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent, #00c2de);
  flex-shrink: 0;
  cursor: pointer;
}

.download-declaration-label a {
  color: var(--accent, #00c2de);
  text-decoration: none;
}

.download-declaration-label a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .download-modal {
    padding: 28px 20px 22px;
  }

  .download-form-row {
    grid-template-columns: 1fr;
  }
}
