/*
 * CSGO-5331 (CASA finding 4): Roboto is self-hosted rather than fetched from
 * fonts.googleapis.com. The Google Fonts stylesheet cannot carry a Subresource
 * Integrity hash (its response varies by User-Agent and Google rotates it), so
 * vendoring the latin-subset woff2 files removes the un-hashable external
 * dependency entirely. Files live alongside the other static assets in html/.
 */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/roboto-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/roboto-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/roboto-500.woff2') format('woff2');
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #FFFFFF;
}

.container {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.container .title {
    width: 400px;
    max-width: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.title-img {
    height: auto;
}

.sso-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 400px;
    max-width: 90%;
    gap: 10px;
}

.g_id_signin {
    width: 100%;
    display: flex;
    justify-content: center;
}

.microsoft-login-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.microsoft-login-btn {
    background-color: #FFFFFF;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    height: 40px;
    width: auto;
}

.microsoft-login-btn img {
    height: 38px;
    width: auto;
    display: block;
}

.microsoft-login-btn:hover {
    border-color: #333333;
}

/* Organization SSO Button Styling */
.organization-sso-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.organization-sso-btn {
    background-color: #FFFFFF;
    border: 1px solid #dadce0;
    padding: 0 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    height: 40px;
    width: 220px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #3c4043;
    gap: 6px;
    transition: all 0.2s ease-in-out;
}

.organization-sso-btn:hover {
    border-color: #a8a8a8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.organization-sso-btn:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}

.organization-sso-btn img {
    height: 16px;
    width: 16px;
    display: block;
    filter: opacity(0.7);
}

.organization-sso-btn span {
    white-space: nowrap;
    color: #3c4043;
    font-weight: 500;
}


.sso-separator {
    width: 100%;
    max-width: 400px;
    text-align: center;
    border-bottom: 1px solid #dcdcdc;
    line-height: 0.1em;
    margin-top: 25px;
    margin-bottom: 28px;
}

.sso-separator > .sso-separator-text {
    padding: 0 10px;
    background: #fff;
    font-weight: 400;
    font-size: 14px;
    color: #989898;
}

.login-form {
    display: flex;
    flex-direction: column;
    width: 400px;
    max-width: 90%;
}

.label-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.input-label {
    color: #5f6368;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.input-field {
    height: 40px;
    width: 100%;
    border-radius: 4px;
    border: 1px solid #dadce0;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
    font-size: 14px;
    letter-spacing: 0.3px;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}

.input-field::placeholder {
    color: #989898;
}

.forgot-password {
    text-decoration: none;
    font-size: 13px;
    color: #1a73e8;
    line-height: 24px;
    margin-top: 8px;
    align-self: flex-start;
}

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

.col {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 16px;
    cursor: pointer;
}

.checkbox-input {
    height: 16px;
    width: 16px;
    margin: 0;
}

button.login,
button#login-btn {
    width: 100%;
    height: 40px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    background-color: #1a73e8;
    color: #ffffff;
    border: none;
}

button.login:disabled,
button#login-btn:disabled {
    background-color: #dedede;
    color: #7a7a7a;
    cursor: default;
}

.input-field:disabled {
    background-color: #f5f5f5;
    color: #7a7a7a;
    cursor: not-allowed;
    border-color: #dedede;
}

.form-disabled {
    position: relative;
    opacity: 0.8;
}

.form-disabled::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(245, 245, 245, 0.1);
    pointer-events: none;
}

.learn-more {
    display: inline-block;
    margin-top: 24px;
    padding: 8px 0px;
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
}

.learn-more:hover {
    text-decoration: underline;
}

.incorrect,
.use-supervisor,
.invalid-reset-link {
    margin-top: 12px;
    display: none;
    color: #d93025;
    font-size: 13px;
    width: 400px;
    max-width: 90%;
    text-align: left;
}

p.error.incorrect {
    display: block;
}

/* Organization SSO Mode Indicator */
.organization-sso-mode-indicator {
    width: 400px;
    max-width: 90%;
    background-color: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease-out;
}

.mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mode-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
}

.mode-description {
    margin: 0;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.4;
}

.back-to-standard-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
    color: #5f6368;
    transition: all 0.2s ease-in-out;
}

.back-to-standard-btn:hover {
    background-color: #f1f3f4;
    color: #202124;
}

.back-to-standard-btn:focus {
    outline: none;
    background-color: #e8f0fe;
    color: #1a73e8;
}

/* Hide elements in organization SSO mode */
.organization-sso-mode .sso-container {
    display: none;
}

.organization-sso-mode .sso-separator {
    display: none;
}

.organization-sso-mode #password-input {
    display: none;
}

.organization-sso-mode .label-group:nth-of-type(2) {
    display: none;
}

.organization-sso-mode .remember-me-label {
    display: none;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Smooth transitions */
.sso-container,
.sso-separator,
.label-group {
    transition: all 0.3s ease-in-out;
}

/* Error Message Styles */
.error-message {
    display: flex;
    align-items: flex-start;
    width: 400px;
    max-width: 90%;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

/* Error styling */
.error-message.error-type {
    background-color: #fce8e6;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Info styling for development messages */
.error-message.info-type {
    background-color: #e7f3ff;
    border: 1px solid #b3d4fc;
    color: #0c5460;
}

.error-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.error-text {
    flex: 1;
    font-weight: 400;
    margin-right: 8px;
}

.error-dismiss {
    background: none;
    border: none;
    color: #721c24;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 4px;
    margin: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.error-dismiss:hover {
    background-color: rgba(114, 28, 36, 0.1);
}

.error-dismiss:focus {
    outline: none;
    background-color: rgba(114, 28, 36, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design improvements */
@media (max-width: 480px) {
    .organization-sso-btn {
        min-width: auto;
        width: 100%;
        font-size: 13px;
        padding: 0 12px;
    }
    
    .organization-sso-text {
        white-space: normal;
        text-align: center;
    }
    
    .organization-sso-mode-indicator {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .mode-title {
        font-size: 15px;
    }
    
    .mode-description {
        font-size: 13px;
    }
}

/* Focus indicators for better accessibility */
.organization-sso-btn:focus-visible,
.back-to-standard-btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .organization-sso-btn {
        border-width: 2px;
    }
    
    .organization-sso-mode-indicator {
        border-width: 2px;
    }
}

/* Clean Login Error Message Styling */
.login-error-message {
    display: none;
    width: 400px;
    max-width: 90%;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 16px auto;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

.login-error-message .error-content h4 {
    margin: 0 0 8px 0;
    color: #c53030;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
}

.login-error-message .error-content p {
    margin: 0;
    color: #742a2a;
    font-size: 14px;
    line-height: 1.4;
    font-family: 'Roboto', sans-serif;
}

.login-error-message .error-content a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.login-error-message .error-content a:hover {
    text-decoration: underline;
}

/* Responsive design for error message */
@media (max-width: 480px) {
    .login-error-message {
        margin: 12px 8px;
        padding: 14px 16px;
    }

    .login-error-message .error-content h4 {
        font-size: 15px;
    }

    .login-error-message .error-content p {
        font-size: 13px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .organization-sso-btn,
    .back-to-standard-btn,
    .sso-container,
    .sso-separator,
    .label-group {
        transition: none;
    }

    .organization-sso-mode-indicator,
    .error-message-card {
        animation: none;
    }

    @keyframes slideIn {
        from, to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideOut {
        from, to {
            opacity: 0;
            transform: translateY(0);
        }
    }
}
