:root {
    color-scheme: light dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.gradient-background {
    background: linear-gradient(135deg, #a8e9e3 0%, #fefefe 35%, #fefefe 65%, #b1acfd 100%);
    background-size: 100% 100%;
    background-attachment: fixed;
}

@media (prefers-color-scheme: dark) {
    body.gradient-background {
        background:
            linear-gradient(135deg, #4dd0c0 0%, #66d4ca 20%, #7bc7d4 35%, #8fb8dd 50%, #a3a9e5 65%, #b7a0ed 80%, #c997f4 100%);
        background-size: 100% 100%;
        background-attachment: fixed;
        position: relative;
    }

    body.gradient-background::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background:
            radial-gradient(ellipse 120% 80% at 0% 100%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.98) 10%, rgba(0,0,0,0.95) 20%, rgba(0,0,0,0.9) 30%, rgba(0,0,0,0.8) 40%, rgba(0,0,0,0.65) 50%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0.3) 70%, transparent 85%),
            radial-gradient(ellipse 120% 80% at 100% 0%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.98) 10%, rgba(0,0,0,0.95) 20%, rgba(0,0,0,0.9) 30%, rgba(0,0,0,0.8) 40%, rgba(0,0,0,0.65) 50%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0.3) 70%, transparent 85%),
            radial-gradient(ellipse 600% 200% at 50% 50%, transparent 0%, transparent 10%, rgba(0,0,0,0.25) 25%, rgba(0,0,0,0.5) 35%, rgba(0,0,0,0.65) 40%, rgba(0,0,0,0.75) 45%, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.75) 55%, rgba(0,0,0,0.65) 60%, rgba(0,0,0,0.5) 65%, rgba(0,0,0,0.25) 75%, transparent 90%, transparent 100%),
            linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.35) 25%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.35) 75%, transparent 100%);
        pointer-events: none;
        z-index: -1;
    }
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: light-dark(#1D2324, #EBEFF0);
    min-height: 100vh;
}

body>main {
    padding: 0;
    display: flex;
    min-height: 100vh;
    justify-content: center;
}

.content-wrapper {
    width: 800px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-flow: column wrap;
}

main.page-body {
    width: 430px;
    max-width: 100%;
    padding: 0;
}

.panel {
    background: light-dark(#ffffff, #1D2324);
    border: none;
    color: light-dark(#1D2324, #EBEFF0);
    border-radius: 8px;
    box-shadow: none;
    border-top: none;
    padding: 2rem 1.5rem 1rem 1.5rem;
}

.panel h2 {
    margin: 0.25rem 0 0.5rem 0;
    color: light-dark(#1D2324, #EBEFF0);
    font-size: 24px;
    padding: 0 0 20px 0;
}

.panel>main {
    padding: 0;
}

.panel a {
    color: light-dark(#1D2324, #EBEFF0) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.panel a:hover {
    color: light-dark(#1D2324, #EBEFF0) !important;
}

.montel-logo {
    width: 100%;
    margin-bottom: 30px;
    margin-top: 20px;
}

.montel-logo svg path {
    fill: light-dark(#01796E, #EBEFF0);
}

.text-center {
    text-align: center;
}

.form-title-with-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-bottom: 1.5rem;
}

.form-title-with-icon h2 {
    margin: 0;
    padding: 0;
}

.application-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(45deg, #B7E6E6 0%, #C1C0FC 100%);
    font-size: 28px;
    color: #01796E;
    flex-shrink: 0;
}

form {
    width: 100%;
}

form fieldset {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 0;
    margin: 0;
}

.form-row {
    margin-bottom: 1.25rem;
    width: 100%;
}

.form-row>label:first-of-type {
    margin-bottom: 0.5rem;
}

label {
    display: block;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.5rem;
    color: light-dark(#596C6E, #9AADAF);
}

input {
    border: 1px solid light-dark(#B9C7C9, #596C6E) !important;
    border-radius: 4px !important;
    background-color: transparent !important;
    color: light-dark(#1D2324, #EBEFF0);
    font-size: 18px !important;
    padding: 9px 12px !important;
    line-height: 22px !important;
    box-shadow: none !important;
    width: 100%;
    font-family: 'Roboto', sans-serif;
    outline: none;
}

input::placeholder {
    color: light-dark(#596C6E, #9AADAF) !important;
    font-size: 18px !important;
}

input:hover {
    border-color: light-dark(#7A9496, #7A9496) !important;
}

input:focus {
    border-color: light-dark(#7A9496, #7A9496) !important;
}

.button.blue {
    background-color: light-dark(#01796E, #01796E) !important;
    padding: 0px 16px 2px 16px !important;
    border-radius: 24px !important;
    font-size: 16px !important;
    height: 40px !important;
    min-width: 168px !important;
    font-weight: 600 !important;
    color: light-dark(#EBEFF0, #EBEFF0) !important;
    border: none;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.2s ease;
}

.button.blue:hover {
    background-color: light-dark(#4DA199, #4DA199) !important;
}

.button.blue:active {
    background-color: light-dark(#4DA199, #4DA199) !important;
}

.button.blue:focus {
    background-color: light-dark(#4DA199, #4DA199) !important;
}

.button.blue:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-spinner {
    display: none;
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.button.blue.loading .button-text {
    opacity: 0;
}

.button.blue.loading .button-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.forgot-password-link {
    float: right;
    margin-top: 1rem;
}

.hr-container {
    padding: 1em 0;
    position: relative;
    text-align: center;
}

.hr-container > div {
    color: light-dark(#6c757d, #ACB5B9) !important;
    background: light-dark(#ffffff, #1D2324) !important;
    position: relative;
    display: inline-block;
    padding: 0 10px;
    z-index: 1;
}

.hr-container > hr {
    border: none;
    border-top: 1px solid light-dark(#dee2e6, #ACB5B9) !important;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
}

.centered {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.password-wrapper {
    position: relative;
}

.password-icon {
    color: light-dark(#596C6E, #9AADAF);
    position: absolute;
    right: 8px;
    top: 6px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-icon svg {
    width: 32px;
    height: 32px;
}

.password-icon svg path {
    fill: light-dark(#5B7B7E, #ACB5B9);
}

.password-icon-hide {
    display: none;
}

.password-icon-show {
    display: inline-flex;
}

span.error {
    display: none;
    margin-top: 4px;
    color: light-dark(#BB4258, #BB4258);
    font-size: 12px;
}

span.error.visible {
    display: block;
}

.error.general-error {
    display: none;
    padding: 10px 12px;
    background: rgba(187, 66, 88, 0.1);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 1rem;
    color: light-dark(#BB4258, #BB4258);
}

.error.general-error.visible {
    display: block;
}

input.error-input {
    border-color: light-dark(#BB4258, #BB4258) !important;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

form.success {
    animation: fadeOut 0.3s ease forwards;
}

@media (max-width: 768px) {
    body>main {
        padding: 20px;
    }

    .content-wrapper {
        width: 100%;
    }

    main.page-body {
        width: 100%;
    }

    .panel {
        padding: 1.5rem 1rem 1rem 1rem;
    }

    .panel h2 {
        font-size: 20px;
    }

    .montel-logo {
        margin-bottom: 20px;
        margin-top: 10px;
    }

    .montel-logo svg {
        width: 240px;
        height: auto;
    }
}

@media (max-width: 480px) {
    body>main {
        padding: 12px;
    }

    .panel {
        padding: 1.25rem 1rem 1rem 1rem;
    }

    .montel-logo svg {
        width: 200px;
    }

    .application-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .panel h2 {
        font-size: 18px;
    }

    input {
        font-size: 16px !important;
    }

    .button.blue {
        font-size: 14px !important;
        min-width: 140px !important;
    }
}

