/* Import Material Design fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%) fixed;
}

/* Hide default Keycloak header */
#kc-header {
    display: none;
}

/* Main login container */
.login-pf {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative; /* establish containing block for pseudo element */
    overflow: hidden; /* ensure image does not cause scrollbars */
}

/* Right-side full-height decorative background image for the login screen */
.login-pf::after {
    --login-bg-image: url("../images/teavaro-logo-bg.svg");
    --login-bg-opacity: 0.10;
    --login-bg-width: min(1000vw, 100vh);
    content: "";
    position: fixed; /* fixed so it spans viewport height regardless of scroll */
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh; /* full viewport height */
    width: var(--login-bg-width); /* right-side panel width; tune as needed */
    pointer-events: none; /* don't block interactions */
    z-index: 0; /* behind the card */
    /* Use CSS custom property for the image; set it to a url('...png' or '...svg') */
    background-repeat: no-repeat;
    background-position: right center;
    /* Scale image to fill available vertical space (preserve aspect ratio) */
    background-size: auto 100%;
    /* Adjustable transparency for overlay */
    opacity: var(--login-bg-opacity);
    background-image: var(--login-bg-image, none);
}

/* Ensure the content stays above the decorative image */
.login-pf > * {
    position: relative;
    z-index: 1;
}

/* On small screens, hide the right-side image to prioritize form space */
@media (max-width: 768px) {
    .login-pf::after {
        display: none;
    }
}

/* Application title */
.app-title {
    position: fixed;
    top: 48px;
    left: 86px;
    color: #001C38;
    font-size: 36px;
    font-style: normal;
    font-weight: 400;
    line-height: 44px;
}

/* Login card container */
.login-pf .card-pf {
    background: #EDEDF4;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 18px 24px;
    width: 100%;
    margin: 0;
    border: none;
    min-width: 280px;
    max-width: 464px;
}

/* Remove default card styling */
.card-pf {
    background: #EDEDF4 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Form title */
#kc-page-title {
    color: #191C20;
    text-align: left;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0;
}

/* Form subtitle */
.form-subtitle {
    font-size: 14px;
    color: #43474E;
    margin-bottom: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0;
}

/* Form groups */
.form-group {
    margin-bottom: 10px;
    position: relative;
    gap: 8px;
}

/* Material Design Text Field Container */
.mdc-text-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
}

.mdc-text-field--outlined {
    background: transparent;
}

.mdc-text-field__input {
    width: 100%;
    height: 48px;
    padding: 16px 16px 16px 16px;
    border: 1px solid #43474E;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    background: #EDEDF4;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.mdc-text-field__input:focus {
    outline: none;
    border-color: #3B608F;
    border-width: 2px;
}

.mdc-text-field--with-trailing-icon .mdc-text-field__input {
    padding-right: 48px;
}

/* Trailing icon */
.mdc-text-field__icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #43474E;
    font-size: 16px;
    pointer-events: none;
}

/* Floating labels */
.mdc-floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #43474E;
    transition: all 0.2s ease;
    pointer-events: none;
    background: #EDEDF4;
    padding: 0 4px;
}

.mdc-text-field__input:focus + .mdc-floating-label,
.mdc-text-field__input:not(:placeholder-shown) + .mdc-floating-label {
    top: 0;
    left: 12px;
    font-size: 12px;
    color: #43474E;
    transform: translateY(-50%);
}

/* Supporting text */
.mdc-text-field-helper-text {
    font-size: 12px;
    color: #757575;
    margin-top: 4px;
    margin-left: 16px;
    line-height: 1.33;
}

/* Input error styling */
.input-error {
    display: block;
    font-size: 12px;
    color: #d32f2f;
    margin-top: 4px;
    margin-left: 16px;
}

.mdc-text-field__input[aria-invalid="true"] {
    border-color: #d32f2f;
}

/* Primary button */
.btn-primary {
    width: 100%;
    height: 48px;
    background: #3B608F;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    /*margin-bottom: 16px;*/
    gap: 8px;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-primary:active {
    background: #0d47a1;
}

/* Forgot password link */
.forgot-password {
    text-align: left;
    margin-top: 8px;
    margin-bottom: 24px;
}

.forgot-password a {
    color: #3B608F;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Social login section */
.social-login-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

/* Microsoft SSO button */
.social-microsoft {
    width: 100%;
    height: 38px;
    background: #EDEDF4;
    border-radius: 4px;
    color: #3B608F;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background-color 0.2s ease;
    border: 1px solid #3B608F;
}

.social-microsoft:hover {
    background: #106ebe;
    color: #ffffff;
    text-decoration: none;
}

/* Registration link */
.registration-section {
    text-align: center;
    margin: 16px 0 16px 0;
}

.registration-divider {
    margin: 32px 0;
    border: 0.75px solid #C3C6CF;
}

.registration-section span {
    color: #43474E;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: 0;
}

.registration-section a {
    color: #3B608F;
    text-decoration: none;
    font-size: 14px;
    margin-left: 6px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0;
}

.registration-section a:hover {
    text-decoration: underline;
}

/* Email verification specific styles */
.verification-info {
    text-align: center;
    padding: 20px 0;
}

.verification-icon {
    margin-bottom: 24px;
}

.verification-text {
    font-size: 16px;
    color: #424242;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Remove default keycloak styling */
.login-pf-page {
    background: transparent !important;
}

.login-pf-brand {
    display: none;
}

.login-pf-header {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .login-pf .card-pf {
        padding: 32px 24px;
        margin: 0 16px;
        max-width: none;
    }

    .app-title {
        position: relative;
        top: auto;
        left: auto;
        text-align: center;
        margin-bottom: 32px;
        color: #001C38;
    }
}

/* Error messages */
.alert-error {
    background: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1565c0;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Checkbox styling */
.checkbox {
    display: flex;
    align-items: center;
    margin: 16px 0;
    background: #EDEDF4;
}

.checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    background-color: #EDEDF4 !important;
    color: #EDEDF4 !important;
}

.checkbox label {
    margin: 0;
    font-size: 14px;
    color: #424242;
    cursor: pointer;
}

/* Legacy compatibility styles */
.form-control {
    width: 100%;
    height: 56px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    background: #EDEDF4;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1976d2;
    border-width: 2px;
}

.form-actions {
    text-align: center;
    margin-top: 24px;
}

.form-actions a {
    color: #1976d2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

.form-actions a:hover {
    text-decoration: underline;
}