* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #d7e6ec;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 28px 20px;
  color: #fff;
  font: 13.5px/1.4 Arial, sans-serif;
}

form,
#success {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.panel {
  margin-bottom: 14px;
  border-radius: 4px;
  background: #619d9e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #158a89;
}

.row:last-child {
  border-bottom: 0;
}

.row span,
.row dt {
  flex: 0 0 70px;
  font-weight: 500;
}

[dir='rtl'] .row span {
  flex-basis: 104px;
  white-space: nowrap;
}

.row input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: #fff;
  font: inherit;
}

.row input::placeholder {
  color: #acd7e4;
  opacity: 1;
}

.row.is-invalid input {
  color: #ff0000;
}

.row.is-invalid,
[dir='rtl'] .row.is-invalid {
  box-shadow: inset 0 -2px 0 #ff0000;
}

.row.is-focused {
  box-shadow: inset 2px 0 0 #fff;
}

[dir='rtl'] .row.is-focused {
  box-shadow: inset -2px 0 0 #fff;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
}

/* A cross-origin frame has no height of its own, so its container needs one. */
.card-row .field {
  height: 22px;
}

#card-number {
  flex: 1;
  min-width: 0;
}

#card-expiry {
  flex: 0 0 52px;
}

#card-cvv {
  flex: 0 0 34px;
}

.card-row .is-invalid {
  box-shadow: 0 2px 0 #ff0000;
}

button {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border: 0;
  border-radius: 4px;
  background: #158a89;
  color: #fff;
  font: 500 15px 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
}

[dir='rtl'] button {
  font-family: Arial, sans-serif;
}

button:hover:enabled {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

/* Below the button, so a message doesn't move the centred form. */
#error {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin: 10px 0 0;
  color: #000;
  text-align: center;
}

#success {
  padding-bottom: 12px;
}

#success h1 {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid #158a89;
  font-size: 15px;
  font-weight: 600;
}

#success dl {
  margin: 0;
}

#success dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#again {
  display: block;
  width: calc(100% - 24px);
  margin: 12px 12px 0;
}
