html {
  height: 100%;
}

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #d9e2ec;
  --text: #243447;
  --muted: #6b7b8f;
  --primary: #0f5f8f;
  --primary-dark: #083b5c;
  --success-bg: rgba(40, 167, 69, 0.13);
  --success: #238847;
  --danger-bg: rgba(255, 7, 58, 0.13);
  --danger: #d7193f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 30px));
  margin: 0 auto;
}

.site-header {
  background: var(--primary-dark);
  color: #ffffff;
  border-bottom: 4px solid #f3b233;
}

.header-inner,
.footer-inner,
.title-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-inner {
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-text {
  display: grid;
}

.brand-text strong {
  font-size: 17px;
}

.brand-text small,
.muted {
  color: rgba(255, 255, 255, 0.72);
}

.page-title {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.title-inner {
  min-height: 120px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 28px;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 20px;
}

.page-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.content-grid {
  padding: 28px 0 44px;
}

.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
}

.panel-heading {
  padding: 14px 18px;
  background: #eef4f8;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 18px;
}

.form-row {
  display: grid;
  gap: 7px;
  max-width: 460px;
  margin-bottom: 16px;
}

label {
  font-weight: 700;
}

input {
  width: 100%;
  height: 42px;
  padding: 8px 11px;
  border: 1px solid #b8c4d2;
  border-radius: 0;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(15, 95, 143, 0.18);
  border-color: var(--primary);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 460px;
}

button {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover,
button:focus {
  background: #0b4f78;
}

button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.loader {
  color: #b86e00;
  font-weight: 700;
  white-space: nowrap;
}

.hidden {
  display: none;
}

.result-output {
  padding: 0 18px 20px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.table th,
.table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #eef4f8;
}

.success {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
}

.danger {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
}

.alert {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.alert-danger,
.invalid-result {
  color: var(--danger);
}

.site-footer {
  background: var(--primary-dark);
  color: #ffffff;
  padding: 18px 0;
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .header-inner,
  .footer-inner,
  .title-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .title-inner {
    min-height: 100px;
    justify-content: center;
  }

  h1 {
    font-size: 24px;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }
}
