* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-input: #ffffff;
  --border-default: #d1d5db;
  --border-focus: #222;
  --text-primary: #222;
  --text-secondary: #666;
  --text-muted: #9ca3af;
  --accent: #000;
  --error-color: #dc2626;
  --radius: 8px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Logo + Title row */
.logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

#logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

h1 {
  font-family: "Fugaz One", sans-serif;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1;
}

/* IP info */
#ip-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

#ip-info.hidden {
  display: none;
}

#ip-address {
  color: var(--accent);
  font-weight: 500;
}

#ip-region {
  color: var(--text-muted);
}

/* Form */
#proxy-form {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 12px;
}

#address {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#address:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.1);
}

#address::placeholder {
  color: var(--text-muted);
}

/* Buttons */
button[type="submit"] {
  padding: 14px 28px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}

button[type="submit"]:hover {
  opacity: 0.85;
}

button[type="submit"]:active {
  opacity: 0.7;
}

/* Error */
#error {
  color: var(--error-color);
  font-size: 14px;
  margin-bottom: 8px;
  text-align: center;
}

#error.hidden {
  display: none;
}

/* Back bar */
#back-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 12px;
  z-index: 999999;
}

#back-bar.hidden {
  display: none;
}

#proxy-status {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#back-btn {
  padding: 8px 18px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}

#back-btn:hover {
  opacity: 0.85;
}

#toggle-bar-btn {
  padding: 6px 8px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

#toggle-bar-btn:hover {
  color: var(--text-primary);
}

/* Collapsed back-bar */
#back-bar.collapsed {
  background: transparent;
  border-bottom: none;
  width: auto;
  height: auto;
  padding: 6px;
}

#back-bar.collapsed #back-btn {
  display: none;
}

#back-bar.collapsed #proxy-status {
  display: none;
}

#back-bar.collapsed #toggle-bar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: auto;
  height: auto;
  padding: 6px 8px;
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-bar.collapsed #toggle-bar-btn:hover {
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 600px) {
  #proxy-form {
    flex-direction: column;
  }

  button[type="submit"] {
    width: 100%;
  }

  .container {
    padding: 32px 16px 24px;
  }

  h1 {
    font-size: 32px;
  }

  #logo {
    width: 40px;
    height: 40px;
  }

  .logo-row {
    gap: 10px;
    margin-bottom: 20px;
  }
}