* {
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  margin: 0;
  background: #f4f8fc;
  color: #111;
  display: flex;
  justify-content: center;
  padding: 40px 15px;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark {
  background: #020617;
  color: #f8fafc;
}

.container {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

body.dark .container {
  background: #0f172a;
}

.logo {
  text-align: center;
  margin-bottom: 12px;
}

.logo img {
  max-height: 60px;
}


h2 {
  text-align: center;
  margin: 10px 0 5px;
}

.subtitle {
  text-align: center;
  color: #555;
  font-size: 14px;
}

body.dark .subtitle {
  color: #cbd5f5;
}

.field {
  position: relative;
  margin-bottom: 22px;
}


.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 16px 14px;
  border-radius: 10px;
  border: 1.6px solid #cbd5e1;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: inherit;
}


.field textarea {
  min-height: 120px;
  resize: vertical;
}


.field select {
  appearance: none;
  cursor: pointer;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #4db8ff;
  box-shadow: 0 0 0 3px rgba(77,184,255,0.25);
}


.field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  background: inherit;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  pointer-events: none;
  transition: 0.2s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field select:focus + label,
.field select:not([value=""]) + label {
  top: -8px;
  font-size: 12px;
}


body.dark .field label {
  color: #e5e7eb;
}

.rating {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 28px;
  margin-bottom: 20px;
}

.rating span {
  cursor: pointer;
  color: #cbd5e1;
  transition: transform 0.15s ease, color 0.15s ease;
}

.rating span.active {
  color: #ffcc00;
  transform: scale(1.25);
}


button {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4db8ff, #38bdf8);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}


button.loading .btn-text {
  visibility: hidden;
}

button.loading .loader {
  opacity: 1;
}

.loader {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#status {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
}


.theme-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 30px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  z-index: 1000;
}

body.dark .theme-switch {
  background: #020617;
}

.switch {
  position: relative;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 20px;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: #38bdf8;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}
