/* ============================================================
   Блок входа и дашборда на главной странице для гостя
   ============================================================ */

body {
    #page-wrapper {
        display: grid;
        grid-template-rows: auto 1fr auto;
        min-height: 100vh;

        #page {
            display: grid;
            grid-template-rows: 1fr;
            min-height: auto;
            padding: 0;

            #page-content {
                min-height: 100%;
                max-width: 100% !important;
                background-color: #eef3ee;
                background-image: url('../pix/sfu/bg_gradient_20years.png');
                background-size: cover;
                background-position: center top;
                background-repeat: no-repeat;
                padding-bottom: 0 !important;

                .main-content {
                    display: none;
                }

                #region-main-box {
                    height: 100%;

                    #region-main {
                        display: flex;
                        flex-direction: column;
                        height: 100%;
                        justify-content: space-between;
                        background-color: transparent !important;

                        div[role="main"] {
                            height: 100%;
                        }

                        .loginform {
                            height: 100%;
                            display: flex;
                            flex-direction: column;
                            justify-content: center;
                            align-items: center;
                            margin: 38px 0;
                        }
                    }
                }
            }
        }

        .fd-module {
            padding: 60px 46px 70px 46px;
            background-color: #FFF;

            @media (min-width: 768px) {
                padding-left: 2vw;
                padding-right: 2vw;
            }

            @media (min-width: 992px) {
                padding-left: 4vw;
                padding-right: 4vw;
            }

            @media (min-width: 1280px) {
                padding-left: 150px;
                padding-right: 0;
            }


            .fd-ecourses {
                font-weight: bold;
                font-size: 3rem;
            }

            .fd-system {
                max-width: 650px;
                margin-top: 11px;
                font-weight: 300;
                font-size: 1.75rem;
            }

            .fd-content {
                margin-top: 42px;
                max-width: 880px;
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                gap: 28px 40px;

                @media (min-width: 648px) {
                    justify-content: space-between;
                }

                .fd-item {
                    .fd-item-title {
                        font-size: 1.5rem;

                        @media (min-width: 768px) {
                            font-size: 1.75rem;
                        }

                        @media (min-width: 1280px) {
                            font-size: 2.25rem;
                        }
                    }

                    .fd-item-value {
                        font-size: 1.875rem;
                        font-weight: bold;

                        @media (min-width: 768px) {
                            font-size: 2.125rem;
                        }

                        @media (min-width: 1280px) {
                            font-size: 2.625rem;
                        }
                    }
                }
            }
        }

        .fl-module {
            --fl-pine: #0b3d2e;
            --fl-ink: #122a20;
            --fl-mute: #5c7268;
            --fl-lime: #d7f95c;
            --fl-amber: #b45309;
            --fl-blue: rgba(0, 56, 123, 1);
            --fl-blue-hover: rgba(20, 76, 143, 1);
            --fl-border: rgba(174, 168, 186, 1);
            --fl-border-hover: #9b94a8;
            font-family: inherit;
            max-width: 480px;
            padding: 0 .75rem;
        }

        .fl-error {
            background-color: rgba(180, 83, 9, 0.08);
            color: #8a3c10;
            border: 1px solid rgba(180, 83, 9, 0.3);
            border-left: 4px solid #b45309;
            border-radius: 8px;
            padding: 0.85rem 1rem;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
            font-weight: 500;
            line-height: 1.4;
            animation: fl-rise 0.3s cubic-bezier(.22, 1, .36, 1) both;
        }

        .fl-error a {
            color: #b45309;
            text-decoration: underline;
        }

        @keyframes fl-rise {
            from {
                opacity: 0;
                transform: translateY(22px);
            }
            to {
                opacity: 1;
                transform: none;
            }
        }

        /* ----- Белая карточка ----- */

        .fl-form {
            background-color: #fff;
            padding: 2.5rem 3.75rem;
            color: var(--fl-ink);
            border-radius: 22px;
        }

        .fl-formhead {
            margin-bottom: 2rem;
        }

        .fl-formtitle {
            font-weight: 700;
            font-size: 1.6rem;
            line-height: 1.15;
            letter-spacing: -.01em;
            margin: 0 0 .35rem;
            color: var(--fl-ink);
        }

        .fl-formsub {
            margin: 0;
            font-size: .9rem;
            color: var(--fl-mute);
        }

        /* ----- Поля ----- */

        .fl-field {
            margin-bottom: 1.4rem;
        }

        .fl-field label {
            display: block;
            font-size: .68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .16em;
            color: var(--fl-mute);
            margin-bottom: .45rem;
        }

        .fl-inputwrap {
            position: relative;
        }

        .fl-field input[type=text],
        .fl-field input[type=password] {
            width: 100%;
            border: 1.5px solid var(--fl-border);
            border-radius: 14px;
            background: #fff;
            padding: .7rem 2.9rem .7rem 2.7rem;
            font-size: 1.05rem;
            font-family: inherit;
            color: var(--fl-ink);
            caret-color: var(--fl-pine);
            transition: border-color .25s, box-shadow .25s;
        }

        .fl-field input:hover {
            border-color: var(--fl-border-hover);
        }

        .fl-field input:focus {
            outline: none;
            border-color: var(--fl-pine);
            box-shadow: 0 0 0 3px rgba(11, 61, 46, .12);
        }

        /* Блеклая подсказка после иконки — гаснет при клике/фокусе */

        .fl-field input::placeholder {
            color: var(--fl-ink);
            opacity: .3;
            font-weight: 400;
            transition: opacity .2s ease;
        }

        .fl-field input:focus::placeholder {
            opacity: 0;
        }

        .fl-icon {
            position: absolute;
            left: .95rem;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            color: var(--fl-mute);
            pointer-events: none;
            z-index: 10;
        }

        /* Кнопка показа пароля */

        .fl-eye {
            position: absolute;
            right: .5rem;
            top: 50%;
            transform: translateY(-50%);
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            padding: 0;
            color: var(--fl-mute);
            transition: color .2s, background .2s;
        }

        .fl-eye:hover {
            color: var(--fl-pine);
            background: rgba(11, 61, 46, .08);
        }

        .fl-eye:active {
            background: rgba(11, 61, 46, .14);
        }

        .fl-eye:focus-visible {
            outline: 2px solid var(--fl-pine);
            outline-offset: 2px;
        }

        .fl-eye svg {
            display: block;
            width: 20px;
            height: 20px;
            transition: transform .25s cubic-bezier(.22, 1, .36, 1);
        }

        .fl-eye:hover svg {
            transform: scale(1.08);
        }

        .fl-eye .fl-slash {
            display: none;
        }

        .fl-eye.is-on {
            color: var(--fl-pine);
        }

        .fl-eye.is-on .fl-slash {
            display: block;
        }

        /* Caps Lock */

        .fl-caps {
            display: none;
            align-items: center;
            gap: .45rem;
            margin: .6rem 0 0;
            font-size: .78rem;
            font-weight: 600;
            color: var(--fl-amber);
        }

        .fl-caps svg {
            width: 14px;
            height: 14px;
            flex: none;
        }

        .fl-caps.is-on {
            display: flex;
            animation: fl-caps-in .3s cubic-bezier(.22, 1, .36, 1);
        }

        @keyframes fl-caps-in {
            from {
                opacity: 0;
                transform: translateY(-4px);
            }
            to {
                opacity: 1;
                transform: none;
            }
        }

        /* ----- Опции ----- */

        .fl-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 0 0 1.75rem;
        }

        .fl-remember {
            display: flex;
            align-items: center;
            gap: .55rem;
            cursor: pointer;
            font-size: .85rem;
            font-weight: 500;
            color: var(--fl-ink);
        }

        .fl-remember input {
            appearance: none;
            width: 16px;
            height: 16px;
            border: 2px solid var(--fl-pine);
            border-radius: 4px;
            margin: 0;
            cursor: pointer;
            position: relative;
            transition: background .2s, transform .15s;
            flex: none;
        }

        .fl-remember input:hover {
            transform: scale(1.08);
        }

        .fl-remember input:checked {
            background: var(--fl-lime);
        }

        .fl-remember input:checked::after {
            content: '✓';
            position: absolute;
            top: -3px;
            left: 1px;
            font-size: 12px;
            font-weight: 700;
            color: var(--fl-pine);
        }

        .fl-forgot {
            line-height: 1.25rem;
            font-size: 1.25rem;
            font-weight: 300;
            color: #000;
            text-decoration: none !important;
            border-bottom: 1px solid #000;
            transition: color .2s, border-color .2s;
        }

        .fl-forgot:hover {
            color: var(--fl-blue);
            border-bottom-color: var(--fl-blue);
        }

        /* ----- Кнопка входа ----- */

        .fl-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: .6rem;
            height: 50px;
            width: 100%;
            border: none;
            border-radius: 11px;
            cursor: pointer;
            color: #fff;
            background-color: var(--fl-blue);
            font-size: 1.375rem;
            font-weight: 500;
            line-height: 1.625rem;
            margin-top: 2.5rem;
            margin-bottom: 1.375rem;
            text-align: center;
        }

        .fl-btn:hover {
            background-color: var(--fl-blue-hover);
        }

        .fl-btn:active {
            transform: translateY(0) scale(.985);
        }

        .fl-btn:focus-visible {
            outline: 3px solid var(--fl-blue);
            outline-offset: 3px;
        }

        /* Автозаполнение Chrome/Safari: гасим жёлтую подложку */

        .fl-field input:-webkit-autofill,
        .fl-field input:-webkit-autofill:hover,
        .fl-field input:-webkit-autofill:focus {
            -webkit-box-shadow: 0 0 0 1000px #fff inset;
            -webkit-text-fill-color: var(--fl-ink);
            caret-color: var(--fl-ink);
        }

        /* ----- Адаптив и доступность ----- */
        @media (max-width: 520px) {
            .fl-form {
                padding: 2.2rem 1.6rem;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .fl-module * {
                animation: none !important;
                transition: none !important;
            }
        }
    }
}
