html, body {
    height: 100%;
    min-height: 100%;
}

html {
    font-size: 8px;
    --nimiq-size: 1rem;
    font-family: Muli, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    --nimiq-gray: #F4F4F5;
    --nimiq-gray-bg: radial-gradient(circle at bottom right, #F4F4F4, var(--nimiq-gray));
    --nimiq-blue: #1F2348;
}

body {
    color: var(--nimiq-blue);
    background: var(--nimiq-gray);
    background-image: var(--nimiq-gray-bg);
    margin: 0;
}

#app {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding-bottom: 9.5rem; /* height of header */
}

#app > header {
    box-sizing: content-box;
    width: calc(100% - 2 * 2rem); /* minus padding */
    padding: 3rem 2rem;
    flex-shrink: 0;
}

.nq-icon {
    width: 1em;
    height: 1em;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    background-size: 100%;
    background-size: contain;
}

.nq-icon.nimiq-logo {
    background-image: url('data:image/svg+xml,<svg width="27" height="24" viewBox="0 0 27 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.7 10.88l-5.63-9.76A2.25 2.25 0 0 0 19.12 0H7.87c-.8 0-1.54.43-1.94 1.13L.3 10.88c-.4.7-.4 1.55 0 2.24l5.63 9.76c.4.7 1.14 1.12 1.94 1.12h11.25c.8 0 1.55-.43 1.95-1.13l5.63-9.75c.4-.7.4-1.55 0-2.24z" fill="url(%23paint0_radial)"/><defs><radialGradient id="paint0_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-26.9977 0 0 -24 27 24)"><stop stop-color="%23EC991C"/><stop offset="1" stop-color="%23E9B213"/></radialGradient></defs></svg>');
}

.logo {
    --signet-width: 3.5rem;
    height: var(--signet-width);
    box-sizing: border-box;
    font-size: calc(.75 * var(--signet-width));
    display: flex;
    align-items: center;
    color: var(--nimiq-blue);
}

.logo .nimiq-logo {
    height: var(--signet-width);
    width: var(--signet-width);
    margin-right: calc(.382 * var(--signet-width)); /* 0.382 times the signet width following the style guide */
}

.logo .logo-wordmark {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-left: -.09em; /* subtract small margin before letter N present in font */
}

/* Subtitle (e.g. NIMIQ Checkout) */
.logo .logo-subtitle {
    margin-left: 0.35em;
}

#loading-spinner .big-hex {
    stroke-dashoffset: -40.5;
    animation: loading-big-hex 4s cubic-bezier(0.76, 0.29, 0.29, 0.76) infinite;
}

#loading-spinner .small-hex {
    stroke-dashoffset: 13;
    animation: loading-small-hex 4s cubic-bezier(0.76, 0.29, 0.29, 0.76) infinite;
}

@keyframes loading-big-hex {
    0%   { stroke-dashoffset: -40.5 }
    17%  { stroke-dashoffset: -15.08 }
    33%  { stroke-dashoffset: 10.33 }
    50%  { stroke-dashoffset: 35.75 }
    67%  { stroke-dashoffset: 61.17 }
    83%  { stroke-dashoffset: 86.58 }
    100% { stroke-dashoffset: 112 }
}

@keyframes loading-small-hex {
    0%   { stroke-dashoffset: 13 }
    17%  { stroke-dashoffset: 38.42 }
    33%  { stroke-dashoffset: 63.84 }
    50%  { stroke-dashoffset: 89.25 }
    67%  { stroke-dashoffset: 114.66 }
    83%  { stroke-dashoffset: 140.08 }
    100% { stroke-dashoffset: 165.5 }
}

/* Mobile Layout */

@media (max-width: 450px) {
    html {
        font-size: 7px !important;
        --nimiq-size: 7px !important;
        touch-action: manipulation; /* remove 300ms delay on mobile touch */
    }

    #app {
        width: 100%;
        padding: 0;
        justify-content: space-between;
    }

    #app > header {
        padding: 2rem;
    }
}

/* Small Desktop Layout */
/* 755px is the height below which standard layouts get a scroll bar. For the onboarding flow, this threshold is 650px,
for single checkout 715px and for multi checkout 843px but 755px seems to be a good compromise. */

@media (max-height: 755px) {
    html {
        font-size: 7px !important;
        --nimiq-size: 7px !important;
    }
}

/*
 * Style copied from https://fonts.googleapis.com/css?family=Muli:400,600,700
 * But manually added woff fallback files.
 */

/* vietnamese */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 400;
    src: local('Muli Regular'), local('Muli-Regular'), url(https://fonts.gstatic.com/s/muli/v12/7Auwp_0qiz-afT3GLRrX.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Auwp_0qiz-afTLGKw.woff) format('woff');
    unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 400;
    src: local('Muli Regular'), local('Muli-Regular'), url(https://fonts.gstatic.com/s/muli/v12/7Auwp_0qiz-afTzGLRrX.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Auwp_0qiz-afTLGKw.woff) format('woff');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 400;
    src: local('Muli Regular'), local('Muli-Regular'), url(https://fonts.gstatic.com/s/muli/v12/7Auwp_0qiz-afTLGLQ.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Auwp_0qiz-afTLGKw.woff) format('woff');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 600;
    src: local('Muli SemiBold'), local('Muli-SemiBold'), url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-ade3iOCr2z3wM.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-ade3iOCX2yQ.woff) format('woff');
    unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 600;
    src: local('Muli SemiBold'), local('Muli-SemiBold'), url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-ade3iOCv2z3wM.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-ade3iOCX2yQ.woff) format('woff');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 600;
    src: local('Muli SemiBold'), local('Muli-SemiBold'), url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-ade3iOCX2zw.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-ade3iOCX2yQ.woff) format('woff');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 700;
    src: local('Muli Bold'), local('Muli-Bold'), url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-adYnjOCr2z3wM.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-adYnjOCX2yQ.woff) format('woff');
    unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 700;
    src: local('Muli Bold'), local('Muli-Bold'), url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-adYnjOCv2z3wM.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-adYnjOCX2yQ.woff) format('woff');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
    font-family: 'Muli';
    font-style: normal;
    font-weight: 700;
    src: local('Muli Bold'), local('Muli-Bold'), url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-adYnjOCX2zw.woff2) format('woff2'),
        url(https://fonts.gstatic.com/s/muli/v12/7Au_p_0qiz-adYnjOCX2yQ.woff) format('woff');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Style copied from https://fonts.googleapis.com/css?family=Fira+Mono&text=0123456789ABCDEFGHJKLMNPQRSTUVXY%20
 * Manually added woff fallback.
 */
@font-face {
    font-family: 'Fira Mono';
    font-style: normal;
    font-weight: 400;
    src: local('Fira Mono Regular'), local('FiraMono-Regular'), url(https://fonts.gstatic.com/l/font?kit=N0bX2SlFPv1weGeLZDtQJOz2uefgU6J9MQqzf7dqJ7MEaOcyg_hbyR-8rlSFUkDt1cpb&skey=bb26c8d476ab3f05&v=v8) format('woff2'), url(https://fonts.gstatic.com/l/font?kit=N0bX2SlFPv1weGeLZDtQIuz2uefgU6J9MQqzf7dqJ7MEaOcyg_hbyR-8rlSFUkDt1cpb&skey=bb26c8d476ab3f05&v=v8) format('woff');
}

#browser-warning-container {
    position: absolute;
    width: 100%;
    height: calc(100% - 6.5rem); /* 6.5rem for header */
    top: 6.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#browser-warning {
    max-width: 75rem;
    margin: 0 3rem;
}

#browser-warning h1 {
    margin-top: 0;
    font-size: 4rem;
}

#browser-warning-message {
    font-size: 2.5rem;
    line-height: 1.3125;
    color: rgba(31, 35, 72, 0.7);
}
