/** This CSS is used by various server side generated pages */

/* Will be inlined by the build process, not requiring an extra roundtrip */
@import 'roboto.css';

:root {
    --main-bg-color: #5268ff;
    --text-color: white;
    --primary-btn-bg-color: white;
    --primary-btn-text-color: #494ff6;
    --Text-Primary: #202020;

    /** Creates a custom safe-area-inset properties that should handle all our users irrespective of the platform they are using
     *  This needs to be set both for our SPA and static pages to ensure our calculations work as expected.
     *  In our Android Native apps, we put the webview in a frame already taking safe area into account, and make sure
     *  we set custom properties (--safe-area-inset-*) to 0px so that we can override the safe-area-inset set on env by
     *  the browser. Since Android, there is more diversity in the behaviour.
     *  When accessing our apps through web, we have the same behaviour as for Android since we use `viewport-fit=cover`,
     *  setting safe-area-inset on env to undefined or 0 by the browser itself.
     *  In the iOS app on the other hand, the webview is covering the whole screen, including the notch and bottom bar,
     *  and the safe-area-inset defined in the webview and needs to be handled by us. Without this fix, Android devices
     *  might get double margins and paddings in cases where the safe-area-inset was set in the browsers env.
     */
    --our-safe-area-inset-top: var(--safe-area-inset-top, env(safe-area-inset-top));
    --our-safe-area-inset-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom));
    --our-safe-area-inset-left: var(--safe-area-inset-left, env(safe-area-inset-left));
    --our-safe-area-inset-right: var(--safe-area-inset-right, env(safe-area-inset-right));
}

/* Normalize CSS */
/* copied from https://csstools.github.io/normalize.css/latest/normalize.css */
/* Document
 * ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

:where(html) {
    line-height: 1.15; /* 1 */
    -webkit-text-size-adjust: 100%; /* 2 */
    text-size-adjust: 100%; /* 2 */
}

/* Sections
 * ========================================================================== */

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Edge, Firefox, and Safari.
 */

:where(h1) {
    font-size: 2em;
    margin-block-end: 0.67em;
    margin-block-start: 0.67em;
}

/* Grouping content
 * ========================================================================== */

/**
 * Remove the margin on nested lists in Chrome, Edge, and Safari.
 */

:where(dl, ol, ul) :where(dl, ol, ul) {
    margin-block-end: 0;
    margin-block-start: 0;
}

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Correct the inheritance of border color in Firefox.
 */

:where(hr) {
    box-sizing: content-box; /* 1 */
    color: inherit; /* 2 */
    height: 0; /* 1 */
}

/* Text-level semantics
 * ========================================================================== */

/**
 * Add the correct text decoration in Safari.
 */

:where(abbr[title]) {
    text-decoration: underline;
    text-decoration: underline dotted;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

:where(b, strong) {
    font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

:where(code, kbd, pre, samp) {
    font-family: monospace, monospace; /* 1 */
    font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

:where(small) {
    font-size: 80%;
}

/* Tabular data
 * ========================================================================== */

/**
 * 1. Correct table border color in Chrome, Edge, and Safari.
 * 2. Remove text indentation from table contents in Chrome, Edge, and Safari.
 */

:where(table) {
    border-color: currentColor; /* 1 */
    text-indent: 0; /* 2 */
}

/* Forms
 * ========================================================================== */

/**
 * Remove the margin on controls in Safari.
 */

:where(button, input, select) {
    margin: 0;
}

/**
 * Remove the inheritance of text transform in Firefox.
 */

:where(button) {
    text-transform: none;
}

/**
 * Correct the inability to style buttons in iOS and Safari.
 */

:where(button, input:is([type="button" i], [type="reset" i], [type="submit" i])) {
    -webkit-appearance: button;
}

/**
 * Add the correct vertical alignment in Chrome, Edge, and Firefox.
 */

:where(progress) {
    vertical-align: baseline;
}

/**
 * Remove the inheritance of text transform in Firefox.
 */

:where(select) {
    text-transform: none;
}

/**
 * Remove the margin in Firefox and Safari.
 */

:where(textarea) {
    margin: 0;
}

/**
 * 1. Correct the odd appearance in Chrome, Edge, and Safari.
 * 2. Correct the outline style in Safari.
 */

:where(input[type="search" i]) {
    -webkit-appearance: textfield; /* 1 */
    outline-offset: -2px; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Safari.
 */

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
    height: auto;
}

/**
 * Correct the text style of placeholders in Chrome, Edge, and Safari.
 */

::-webkit-input-placeholder {
    color: inherit;
    opacity: 0.54;
}

/**
 * Remove the inner padding in Chrome, Edge, and Safari on macOS.
 */

::-webkit-search-decoration {
    -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style upload buttons in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
    -webkit-appearance: button; /* 1 */
    font: inherit; /* 2 */
}

/**
 * Remove the inner border and padding of focus outlines in Firefox.
 */

:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

/**
 * Restore the focus outline styles unset by the previous rule in Firefox.
 */

:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focusring {
    outline: 1px dotted ButtonText;
}

/**
 * Remove the additional :invalid styles in Firefox.
 */

:where(:-moz-ui-invalid) {
    box-shadow: none;
}

/* Interactive
 * ========================================================================== */

/*
 * Add the correct styles in Safari.
 */

:where(dialog) {
    background-color: white;
    border: solid;
    color: black;
    height: -moz-fit-content;
    height: fit-content;
    left: 0;
    margin: auto;
    padding: 1em;
    position: absolute;
    right: 0;
    width: -moz-fit-content;
    width: fit-content;
}

:where(dialog:not([open])) {
    display: none;
}

/*
 * Add the correct display in all browsers.
 */

:where(summary) {
    display: list-item;
}

/* END Normalize CSS */


body {
    color: var(--Text-Primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    font-family: Roboto, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    user-select: none;
    min-height: 85vh; /* Will move .main a bit to the top, but also not take up too much space on native apps */
}

body::before {
    content: '';
    flex-grow: 0.3819661; /* Will introduce a golden ratio margin on top of .main */
}

body.splash {
    background-color: var(--main-bg-color);
}

main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 960px;
    margin: calc(1rem + var(--our-safe-area-inset-top)) calc(1rem + var(--our-safe-area-inset-right)) calc(1rem + var(--our-safe-area-inset-bottom)) calc(1rem + var(--our-safe-area-inset-left));
}

form {
    margin: 0;
    margin-block-end: 0;
}

.centered {
    max-width: 960px;
    margin: 0 auto;
}

.primary {
    background-color: var(--main-bg-color);
    color: white;
    border: none;
    border-radius: 2.75rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: fit-content;
    padding: 1rem 3rem;
    outline: none;
    text-decoration: none;
}

.primary:hover,
.primary:focus {
    background-color: #3853ff;
}

button {
    color: var(--Text-Primary);
    border: none;
    border-radius: 2.75rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: fit-content;
    padding: 1rem 3rem;
    outline: none;
    font-size: 1rem;
}

pre {
    white-space: pre-line;
}

.secondary {
    background-color: #e1e9ff;
    color: var(--main-bg-color);
    border: none;
    border-radius: 2.75rem;
    height: 2.75rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: fit-content;
    padding: 1.5rem 3rem;
    outline: none;
    text-decoration: none;
}

.secondary:hover,
.secondary:focus {
    background-color: #c7d6ff;
}

.safe-area-placeholder {
    background-color: #ffffff;
    position: fixed;
    top: 0;
    width: 100%;
    min-height: var(--our-safe-area-inset-top);
    z-index: 400;
}

body.splash .safe-area-placeholder {
    background-color: var(--main-bg-color);
}

.logged-out-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-color);
    text-align: center;
}

.logged-out-hero-img {
    display: flex;
    max-width: 50vh;
    max-height: 50vh;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.login-btn {
    border-radius: 2.75rem;
    padding: 1rem 3rem;

    text-align: center;
    font-size: 1rem;
    font-weight: bold;

    text-decoration: none;
    cursor: pointer;
    background-color: var(--primary-btn-bg-color);
    color: var(--primary-btn-text-color);
}

.fullwidth {
    width: 100%;
}

.centered {
    text-align: center;
}

.margin2 {
    margin: 2rem 0;
}

.buttongroup {
    display: flex;
    flex-direction: column;
    height: 7rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 2rem;
    text-align: center;
}

h2,
h3 {
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 120%;
    margin: 0;
}

h3 {
    font-size: 1rem;
}

p {
    line-height: 160%;
}

button {
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.25rem;
    padding: 0;
    text-align: start;
}

/* Minimal card component */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.5px 8px 1px rgba(32, 32, 32, 0.12);
    cursor: pointer;
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: 1fr min-content;
}

.card:hover {
    box-shadow: 0 3px 12px 1px rgba(32, 32, 32, 0.18);
}

.card:focus, .card:active {
    box-shadow: 0 1px 4px 1px rgba(85, 87, 94, 0.12);
}

.card button {
    width: 100%;
    padding: 2rem 1rem;
}

.card span {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.card .notice {
    display: flex;
    align-self: start;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 2rem;
    margin-right: 1rem;
    border-radius: 50%;
    line-height: 100% !important;
    background: #F97F7F;
}

/* CMS content */

.cms-content p,
.cms-content ul,
.cms-content ol {
    margin: 0 0 1rem;
    line-height: 160%;
}

.cms-content .highlight-red {
    background-color: #F97F7F;
}

.cms-content .highlight-yellow {
    background-color: #FFC795;
}

.cms-content .highlight-green {
    background-color: #00CEC2;
}
