:root {
  color-scheme: light dark;
  --bg: #f3f6f9;
  --card-bg: #ffffff;
  --border: #d7dee7;
  --primary: #0a642c;
  --primary-hover: #094f23;
  --text: #1c2b3a;
  --muted: #6e7a89;
  --error: #a12020;
  --success: #0b6a2a;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.page {
  width: 100%;
  max-width: 480px;
  padding: 32px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header {
  display: flex;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 100, 44, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

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

.label {
  font-weight: 600;
}

input[type="url"],
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="url"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(10, 100, 44, 0.12);
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin: 0;
}

.fieldset-legend {
  font-weight: 600;
  padding: 0 8px;
}

.alias-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.alias-row select {
  max-width: 180px;
  background: #ecf2ec;
  color: var(--primary);
  font-weight: 600;
}

.alias-row input {
  flex: 1;
}

.hint {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.metadata-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metadata-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.metadata-title {
  font-weight: 600;
}

.metadata-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.secondary-button {
  border: 1px solid var(--primary);
  background: rgba(10, 100, 44, 0.08);
  color: var(--primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.secondary-button:hover {
  background: var(--primary);
  color: #ffffff;
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.link-button {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-button:hover {
  text-decoration: none;
}

.metadata-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submit-button {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.submit-button:not(:disabled):hover {
  background: var(--primary-hover);
}

.submit-button:not(:disabled):active {
  transform: translateY(1px);
}

.message {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.message.error {
  border-color: rgba(161, 32, 32, 0.3);
  background: rgba(161, 32, 32, 0.08);
  color: var(--error);
}

.message.success {
  border-color: rgba(11, 106, 42, 0.3);
  background: rgba(11, 106, 42, 0.08);
  color: var(--success);
}

.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(10, 100, 44, 0.04);
}

.result-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.result-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-link a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

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

.copy-button {
  border: 1px solid var(--primary);
  background: #ffffff;
  color: var(--primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.copy-button:hover {
  background: var(--primary);
  color: #ffffff;
}

.result-details {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-all;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.hidden {
  display: none;
}

@media (max-width: 520px) {
  .card {
    padding: 20px;
  }

  .alias-row {
    flex-direction: column;
  }

  .alias-row select {
    max-width: 100%;
  }
}
