/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@import url("chrome://browser/skin/error-pages.css");

body.certerror {
  width: 100%;
  justify-content: normal;
}

body.caution {
  border-style: solid;
  border-color: #ffe900;
  border-width: 16px;
}

body.captiveportal .title {
  background-image: url("wifi.svg");
}

body.certerror .title {
  background-image: url("cert-error.svg");
}

body.blocked .title {
  background-image: url("chrome://global/skin/icons/blocked.svg");
}

body.clockSkewError .title {
  background-image: none;
  background-repeat: no-repeat;
}

#errorContainer {
  display: none;
}

/* Pressing the retry button will cause the cursor to flicker from a pointer to
 * not-allowed. Override the disabled cursor behaviour since we will never show
 * the button disabled as the initial state. */
button:disabled {
  cursor: pointer;
}

#errorWhatToDoTitle {
  margin-top: 2em;
}

#enableTls10Container {
  display: none;
}

#prefChangeContainer {
  display: none;
}

#learnMoreContainer {
  display: none;
}

#openInNewWindowContainer {
  display: none;
}

#certErrorAndCaptivePortalButtonContainer {
  display: none;
}

#advancedPanelButtonContainer {
  background-color: rgba(128, 128, 147, 0.1);
  display: flex;
  justify-content: end;
  padding: 5px;
  margin-top: 2em;
}

body:not(.neterror) #certErrorAndCaptivePortalButtonContainer {
  display: flex;
}

body:not(.neterror) #netErrorButtonContainer {
  display: none;
}

#netErrorButtonContainer > .try-again {
  margin-top: 1.2em;
}

#advancedButton {
  display: none;
}

body.captiveportal #returnButton {
  display: none;
}

body:not(.captiveportal) #openPortalLoginPageButton {
  display: none;
}

body:not(.clockSkewError) #certErrorAndCaptivePortalButtonContainer > .try-again,
body:not(.clockSkewError) #advancedPanelContainer .try-again {
  display: none;
}

#openPortalLoginPageButton {
  margin-inline-start: 0;
}

body:not(.neterror) #advancedButton {
  display: block;
}

#blockingErrorReporting {
  display: none;
  padding-bottom: 10px;
}

#advancedPanelContainer {
  width: 100%;
  left: 0;
}

.advanced-panel {
  /* Hidden until the link is clicked */
  display: none;
  background-color: var(--in-content-box-background);
  border: 1px solid var(--in-content-box-border-color);
  margin: 48px auto;
  min-width: var(--in-content-container-min-width);
  max-width: var(--in-content-container-max-width);
}

#overrideWeakCryptoPanel {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: space-between;
  align-items: flex-start;
  margin-top: 1em;
}

.mitm-name,
#hostname {
  font-weight: bold;
}

#errorCode {
  cursor: pointer;
  white-space: nowrap;
}

#viewCertificate {
  margin: 0 3em;
}

#badCertTechnicalInfo {
  margin: 3em 3em 1em;
  overflow: auto;
  white-space: pre-wrap;
}

#certificateErrorDebugInformation {
  display: none;
  background-color: var(--in-content-box-info-background) !important;
  border-top: 1px solid var(--in-content-border-color);
  width: 100%;
  padding: 1em 17.5%;
  box-sizing: border-box;
}

#certificateErrorText {
  font-family: monospace;
  white-space: pre-wrap;
  padding: 1em 0;
  display: flex;
  flex-wrap: wrap;
}

#cert_domain_link:not([href]) {
  color: var(--in-content-page-color);
  text-decoration: none;
}

.exceptionDialogButtonContainer {
  display: flex;
  justify-content: end;
}

.exceptionDialogButtonContainer[hidden] {
  display: none;
}

.connectionFailure #errorPageContainer,
.netInterrupt #errorPageContainer,
.netTimeout #errorPageContainer,
.netReset #errorPageContainer,
.netOffline #errorPageContainer {
  background-image: url("chrome://browser/skin/illustrations/error-connection-failure.svg");
}

.dnsNotFound #errorPageContainer {
  background-image: url("chrome://browser/skin/illustrations/error-server-not-found.svg");
}

.malformedURI #errorPageContainer {
  background-image: url("chrome://browser/skin/illustrations/error-malformed-url.svg");
}

.clockSkewError #errorPageContainer {
  background-image: url("chrome://browser/skin/illustrations/blue-berror.svg");
  background-size: 18.5em;
}

.clockSkewError #returnButton {
  display: none;
}

.clockSkewError #advancedButton {
  display: none;
}

.clockSkewError .try-again {
  display: block;
  margin-top: 0.3em;
}

.clockSkewError #exceptionDialogButton {
  display: none;
}

.clockSkewError #advancedPanelReturnButton {
  display: none;
}

.malformedURI .try-again {
  display: none;
}

#wrongSystemTimeWithoutReferencePanel {
  display: none;
}

@media only screen and (max-width: 959px) {
  #certificateErrorText {
    /* The encoded certificate chain looks better when we're not
     * wrapping words on big screens, but at some point we need
     * to wrap to avoid overflowing */
    word-wrap: anywhere;
  }
}

@media only screen and (max-width: 480px) {
  #badCertTechnicalInfo {
    margin: 10px 10px 5px;
  }

  #viewCertificate {
    margin: 0 10px;
  }

  #errorCode {
    /* Break the error code to avoid long codes overflowing the screen */
    white-space: normal;
    word-wrap: anywhere;
  }
}
