/* ==========================================================================
   SLSP Auth Proxy — Shared Design System
   Loaded globally by base.twig. Overrides SimpleSAMLphp default styles.
   Module-specific CSS (slspalmalogin.css, emailselector.css) extends this.
   ========================================================================== */

:root {
    --slsp-primary: #4E4A99;
    --slsp-primary-light: #E5E6F4;
    --slsp-primary-dark: #3D3A7A;
    --slsp-text: #333333;
    --slsp-text-secondary: #666666;
    --slsp-bg: #FFFFFF;
    --slsp-surface: #F8F9FB;
    --slsp-border: #E0E0E6;
}

/* --- Typography --------------------------------------------------------- */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--slsp-text);
    line-height: 1.6;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slsp-text);
    margin: 0 0 1rem;
    border-bottom: none;
}

h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--slsp-text);
    margin: 0 0 0.5rem;
    border-bottom: none;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slsp-text);
}

p {
    line-height: 1.6;
    color: var(--slsp-text-secondary);
}

/* --- Links -------------------------------------------------------------- */

a {
    color: var(--slsp-primary);
    text-decoration: underline;
}

a:hover,
a:focus {
    color: var(--slsp-primary-dark);
    background: none;
    padding: 0;
    text-decoration: underline;
}

a.pure-menu-link:hover,
a.pure-menu-link:focus,
.pure-menu-selected a.pure-menu-link:hover,
.pure-menu-selected a.pure-menu-link:focus {
    color: var(--slsp-primary-dark);
    background: var(--slsp-primary-light);
    padding: .5em 1em;
}

/* --- Header ------------------------------------------------------------- */

#header {
    background: var(--slsp-bg);
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    height: auto;
    min-height: 4.5rem;
    padding: 0.75rem 0;
}

.logo-header {
    min-height: 3.5rem;
    height: auto;
}

#logo {
    color: var(--slsp-text);
    text-shadow: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    gap: 0.75rem;
}

.logo-image {
    height: 3rem;
}

#logo span {
    font-weight: 400;
    color: var(--slsp-text-secondary);
    border-left: 1px solid var(--slsp-border);
    padding-left: 0.75rem;
}

/* Language selector */
.language-menu {
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--slsp-border);
    border-radius: 4px;
    padding: 0.4em 0.6em;
    color: var(--slsp-text);
    background: var(--slsp-bg);
}

.language-bar {
    height: auto;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

/* Mobile menu */
.menu-link span {
    color: var(--slsp-primary);
}

#menu {
    background: var(--slsp-primary);
}

#menu .pure-menu-selected,
#menu .pure-menu-heading {
    background: var(--slsp-primary-dark);
}

#menu .pure-menu ul,
#menu .pure-menu .menu-item-divided {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Content ------------------------------------------------------------ */

#content {
    padding: 2.5rem 0 3rem;
}

/* --- Footer ------------------------------------------------------------- */

#footer {
    background: var(--slsp-surface);
    border-top: 1px solid var(--slsp-border);
    color: var(--slsp-text-secondary);
    height: auto;
    padding: 1.25rem 0;
}

#footer a,
#footer a:visited {
    color: var(--slsp-primary);
    background: none;
}

#footer a:hover,
#footer a:focus,
#footer a:visited:hover,
#footer a:visited:focus {
    color: var(--slsp-primary-dark);
    background: none;
    padding: 0;
    margin: 0;
}

.copyrights {
    font-size: 0.85rem;
    height: auto;
    padding: 0;
}

/* Sticky footer — match SSP negative-margin pattern with our footer height */
#layout {
    margin-bottom: -4rem;
}

#bottom, #push {
    height: 4rem;
}

/* --- Shared Components -------------------------------------------------- */

/* Centered content block */
.content-card {
    max-width: 640px;
    margin: 0 auto;
}

.content-card p {
    margin: 0.5rem 0;
}

.content-card p + p {
    margin-top: 0.75rem;
}

/* Error page heading with icon */
.error-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.error-heading h1 {
    margin: 0;
}

.error-heading .error-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    color: var(--slsp-primary);
}

/* Description text (used by identity picker, email selector) */
.description {
    text-align: center;
    color: var(--slsp-text-secondary);
    margin-bottom: 2rem;
}

/* Error details box */
.error-container {
    max-width: 640px;
    margin: 2rem auto;
}

.error-container p {
    color: var(--slsp-text-secondary);
    line-height: 1.6;
}

.error-details {
    background: var(--slsp-surface);
    border: 1px solid var(--slsp-border);
    border-left: 3px solid var(--slsp-primary);
    border-radius: 6px;
    padding: 1.25em;
    margin: 2em 0 0;
}

.error-reference {
    font-weight: 600;
    margin-bottom: 0.75em;
    color: var(--slsp-text);
}

.error-reference code {
    background: var(--slsp-primary-light);
    color: var(--slsp-primary);
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9em;
}

.technical-details {
    font-size: 0.875rem;
    color: var(--slsp-text-secondary);
}

.timestamp {
    color: #999;
    font-size: 0.875rem;
}

.italic {
    font-style: italic;
}

/* --- Buttons ------------------------------------------------------------ */

.pure-button:hover,
.pure-button:focus {
    background-color: var(--slsp-primary);
    color: #fff;
    padding: .5em 1em;
}

/* --- Responsive --------------------------------------------------------- */

@media screen and (max-width: 40em) {
    #logo {
        font-size: 1.15rem;
    }

    .logo-image {
        height: 2.25rem;
    }

    #header {
        min-height: 3.5rem;
    }

    .logo-header {
        min-height: 3rem;
    }

    #content {
        padding: 1.5rem 0 2rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    #footer {
        padding: 1rem 0;
    }

    #layout {
        margin-bottom: -3rem;
    }

    #bottom, #push {
        height: 3rem;
    }

    .error-heading .error-icon {
        width: 1.75rem;
        height: 1.75rem;
    }
}
