* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.calculator {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  padding: 40px;
  max-width: 760px;
  width: 100%;
}

h1 {
  text-align: center;
  color: #1a1a2e;
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.subtitle {
  text-align: center;
  color: #666;
  font-size: 0.95rem;
  margin: 0 0 28px;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus {
  outline: none;
  border-color: #0f3460;
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.12);
}

button {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 6px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 52, 96, 0.35);
}

button:active {
  transform: translateY(0);
}

.result {
  margin-top: 24px;
  padding: 22px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border-left: 4px solid #0f3460;
}

.result.hidden {
  display: none;
}

.result h3 {
  color: #1a1a2e;
  margin: 0 0 12px;
  font-size: 1.05rem;
  border-bottom: 2px solid rgba(15, 52, 96, 0.18);
  padding-bottom: 8px;
}

.equation-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f3460;
  text-align: center;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.solution-section,
.vertex-section,
.discriminant-section,
.graph-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}

.root-type {
  font-weight: 700;
  color: #0f3460;
  margin: 0 0 8px;
}

.root-value,
.complex-roots p,
.vertex-value,
.discriminant-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  margin: 8px 0;
}

.vertex-value {
  font-weight: 800;
  color: #ff9800;
  font-size: 1.15rem;
}

.discriminant-value {
  font-weight: 800;
  color: #2e7d32;
  font-size: 1.05rem;
}

.no-roots,
.no-vertex,
.no-discriminant {
  color: #666;
  font-style: italic;
  margin: 6px 0 0;
}

#graphCanvas {
  width: 100%;
  height: auto;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  display: block;
  background: #fff;
}
