/* ProAssetSuite look for the Authelia portal: the split layout of the old login page
   (frontend/login.html on development). Caddy serves this folder at /custom/ and links
   this file into every portal page (sites/auth.caddy). Authelia's own markup is not
   ours, so the selectors may need a look after an Authelia upgrade. */

/* Authelia's theme variables, the same palette for every theme (light/dark/grey/oled). */
:root,
html[data-theme] {
    --background: #ffffff;
    --foreground: #0f1729;
    --card: #ffffff;
    --card-foreground: #0f1729;
    --popover: #ffffff;
    --popover-foreground: #0f1729;
    --primary: #1f4e7a;
    --primary-foreground: #ffffff;
    --muted: #f3f4f6;
    --muted-foreground: #6b7280;
    --accent: #eef3f8;
    --accent-foreground: #0f1729;
    --border: #e5e7eb;
    --input: #d1d5db;
    --ring: #1f4e7a;
    --radius: 8px;
    color-scheme: light;
}

html body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    color: #0f1729;
    background: #05101c url('/custom/background.jpg') center / cover no-repeat fixed;
    -webkit-font-smoothing: antialiased;
}

#root,
#root > div {
    background: transparent !important;
}

#root > div:not(.hidden) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
}

/* Language button over the photo, top right. */
#root header {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 5;
    background: transparent !important;
}
#root header button {
    color: rgba(255, 255, 255, 0.85);
}

/* ── The shell: one white card, photo pane left, form right ── */
#root .min-h-\[90vh\] {
    position: relative;
    display: grid !important;
    grid-template-columns: 1.05fr 1fr;
    align-items: stretch !important;
    width: 100%;
    max-width: 1120px;
    min-height: min(680px, calc(100vh - 64px)) !important;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 28px 18px 18px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 30px 70px rgba(0, 0, 0, 0.35);
}

/* Left pane: the photo in a rounded cut-out of the white card. */
#root .min-h-\[90vh\]::before {
    content: '';
    grid-column: 1;
    grid-row: 1;
    margin: 10px;
    border-radius: 18px;
    background: #05101c url('/custom/background.jpg') center / cover no-repeat fixed;
}

/* Brand, top left. */
#root .min-h-\[90vh\]::after {
    content: 'PROASSETSUITE';
    position: absolute;
    top: 50px;
    left: 54px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: #ffffff;
}

/* Right pane: the form, centred. */
#root .min-h-\[90vh\] > div {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    width: 100%;
    max-width: none !important;
    padding: 56px 56px 40px !important;
}
#root .min-h-\[90vh\] > div > div {
    max-width: 360px;
    margin: 0 auto;
}

/* Hero, bottom left. */
#root .min-h-\[90vh\] > div::before {
    content: 'Know every risk.';
    position: absolute;
    left: 54px;
    bottom: 118px;
    max-width: 380px;
    text-align: left;
    font-size: 34px;
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.9px;
    color: #ffffff;
}
#root .min-h-\[90vh\] > div::after {
    content: 'Smart maintenance decisions for industrial assets \2014  powered by FMECA, RCM and real failure data.';
    position: absolute;
    left: 54px;
    bottom: 50px;
    max-width: 340px;
    text-align: left;
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
}

/* Automate the Boring Stuff logo, top right of the card. */
#root .min-h-\[90vh\] > div > div::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 140px;
    height: 70px;
    background: url('/custom/atbs_logo.png') right top / contain no-repeat;
}

/* Authelia's own logo above the title: the brand is on the left now. */
#root .min-h-\[90vh\] img.w-16 {
    display: none;
}

/* Title. Authelia follows the browser's language, so no extra (English-only) subtitle. */
#root .min-h-\[90vh\] h5 {
    text-align: left;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.8px;
    color: #0f1729;
}
/* Fields. */
#root .min-h-\[90vh\] input:not([type='checkbox']) {
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#root .min-h-\[90vh\] input:not([type='checkbox']):focus {
    border-color: #1f4e7a;
    box-shadow: 0 0 0 3px rgba(31, 78, 122, 0.12);
}

/* Buttons: the main action as on the old page, a second one (passkey) outlined. */
#root .min-h-\[90vh\] button.bg-primary,
#sign-in-button {
    background: linear-gradient(135deg, #1f4e7a 0%, #4d6d8b 100%);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    box-shadow: 0 2px 4px rgba(31, 78, 122, 0.3);
    transition: box-shadow 0.2s, transform 0.2s;
}
#root .min-h-\[90vh\] button.bg-primary:hover:not(:disabled),
#sign-in-button:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(31, 78, 122, 0.4);
    transform: translateY(-1px);
}
#root .min-h-\[90vh\] #passkey-sign-in-button {
    background: #ffffff;
    color: #1f4e7a;
    border: 1px solid #d1d5db;
    box-shadow: none;
}
#root .min-h-\[90vh\] #passkey-sign-in-button:hover:not(:disabled) {
    background: #f8fafc;
    box-shadow: none;
}

#root .min-h-\[90vh\] a,
#reset-password-button {
    color: #1f4e7a;
    font-weight: 500;
}

/* Narrow screens: one column, photo strip on top, no hero text. */
@media (max-width: 900px) {
    #root > div:not(.hidden) {
        padding: 56px 16px 16px;
    }
    #root .min-h-\[90vh\] {
        grid-template-columns: 1fr;
        grid-template-rows: 180px auto;
        max-width: 460px;
        min-height: 0 !important;
        border-radius: 18px;
    }
    #root .min-h-\[90vh\]::after {
        top: 34px;
        left: 36px;
    }
    #root .min-h-\[90vh\] > div {
        grid-column: 1;
        grid-row: 2;
        padding: 28px 24px 24px !important;
    }
    #root .min-h-\[90vh\] > div::before,
    #root .min-h-\[90vh\] > div::after {
        display: none;
    }
    #root .min-h-\[90vh\] > div > div::before {
        top: 200px;
        right: 16px;
        height: 48px;
        width: 100px;
    }
}
