/**
 * Login and Password Reset form styles
 * Shared styling for user account management
 */

:root {
    /* Colors */
    --primary-color: #005587;
    --primary-color-light: #1a6bb3;
    --text-color: #2f2f2f;
    --input-border-color: #424242;
    --placeholder-color: #cbcfd6;
    --white: #ffffff;
    --background-color: #dff2fd;
    --submit-button-color: #9d4278;
    --link-color: #005587;
    --required-color: #ff0000;
    --hover-background: #f8f8f8;
    --page-title-background: #ffffff;
    --border-color: #d1e6f5;
    --error-color: #e53935;
    --success-color: #4caf50;
    --warning-color: #ffc107;
    --very-strong-color: #2e7d32;

    /* Typography */
    --font-family: Helvetica, Arial, sans-serif;

    /* Font sizes */
    --page-title-font-size: 24px;
    --title-font-size: 18px;
    --subtitle-font-size: 14px;
    --disclaimer-font-size: 11px;
    --label-font-size: 16px;
    --input-font-size: 14px;
    --description-font-size: 14px;

    /* Line heights */
    --page-title-line-height: 2;
    --title-line-height: 1.25;
    --subtitle-line-height: 1.5;
    --label-line-height: 1.5;
    --input-line-height: 1.5;
    --description-line-height: 1.3;

    /* Letter Spacing */
    --letter-spacing-sm: 0.1px;

    /* Font weights */
    --bold-weight: 700;
    --medium-weight: 500;
    --regular-weight: 400;

    /* Input dimensions */
    --input-width: 350px;
    --input-height: 45px;
    --input-padding-horizontal: 19px;
    --input-padding-verical: 12px;
    --input-padding: var(--input-padding-verical) var(--input-padding-horizontal);
    --input-border-width: 1px;

    /* Transitions */
    --transition-speed: 0.3s;

    /* Animation curves - Added from registration CSS */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
    --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
}

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.page-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--background-color);
}

.login-container {
    width: 100%;
    max-width: calc(var(--input-width) + 80px);
    padding: 64px 20px;
    margin-top: 0;
}

/* Form container for card-like design */
.form-container {
    background-color: var(--white);
    border-radius: 8px;
    padding: 24px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 26px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: var(--input-width);
}

.page-title {
    color: var(--primary-color);
    font-size: var(--page-title-font-size);
    font-weight: var(--bold-weight);
    line-height: var(--page-title-line-height);
    margin: 0 0 20px;
    padding: 0;
    white-space: nowrap;
}

.account-title {
    font-family: var(--font-family);
    font-weight: var(--bold-weight);
    font-size: var(--title-font-size);
    line-height: var(--title-line-height);
    color: var(--primary-color);
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 26px;
    width: 100%;
}

.form-label {
    font-family: var(--font-family);
    font-weight: var(--bold-weight);
    font-size: var(--label-font-size);
    line-height: var(--label-line-height);
    color: #2f2f2f;
    display: block;
}

.required {
    color: var(--required-color);
}

.input-field {
    width: 100%;
    max-width: var(--input-width);
    height: var(--input-height);
    padding: var(--input-padding) !important;
    border: var(--input-border-width) solid var(--input-border-color);
    background-color: var(--white);
    font-family: var(--font-family);
    font-size: var(--input-font-size);
    border-radius: 0;
    transition: border-color 0.3s var(--ease-standard),
        box-shadow 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-back);
    will-change: border-color, box-shadow, transform;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color-light);
    box-shadow: 0 0 0 2px rgba(0, 85, 135, 0.2);
    transform: translateY(-1px);
}

.input-field::placeholder {
    font-family: var(--font-family);
    font-weight: var(--regular-weight);
    font-size: var(--input-font-size);
    line-height: var(--input-line-height);
    color: var(--placeholder-color);
    transition: opacity 0.3s var(--ease-standard);
}

.input-field:focus::placeholder {
    opacity: 0.6;
}

/* Password field with toggle - improved accessibility */
.password-field-container {
    position: relative;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-block !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23424242"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    opacity: 1 !important;
    z-index: 2 !important;
}

.toggle-password:hover {
    background-color: transparent !important;
    opacity: 0.7 !important;
}

.toggle-password:focus {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

.toggle-password.hide-password {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23424242"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>') !important;
}

/* Ensure the password wrapper maintains correct positioning */
.password-input-wrapper .input-field {
    padding-right: 45px !important;
    /* Make room for the toggle button */
}

.login-options {
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-family);
    font-size: var(--description-font-size);
    white-space: nowrap;
}

.login-options__remember-me input[type="checkbox"] {
    width: fit-content;
    margin-bottom: 2.75px;
    cursor: pointer;
}

.login-options__remember-me {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-options__forgot-password a {
    color: #005587;
    font-weight: bold;
}

.submit-button {
    width: 100%;
    max-width: var(--input-width);
    height: var(--input-height);
    background-color: var(--submit-button-color);
    color: var(--white);
    border: none;
    font-family: var(--font-family);
    font-weight: var(--bold-weight);
    font-size: var(--label-font-size);
    cursor: pointer;
    margin: 20px 0 2px;
    transition: background-color var(--transition-speed) ease,
        opacity var(--transition-speed) ease;
    border-radius: 0;
}

.submit-button:hover {
    background-color: #8a3868;
}

.submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(157, 66, 120, 0.3);
}

.form-links {
    width: 100%;
    max-width: var(--input-width);
    display: flex;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-family);
    font-size: var(--input-font-size);
    text-align: center;
}

.login-options__forgot-password,
.register-link {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

.login-options__forgot-password:hover,
.register-link:hover {
    opacity: 0.8;
}

.separator {
    color: var(--text-color);
}

/* Message containers */
.message-container {
    width: 100%;
    max-width: var(--input-width);
    padding: 14px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: var(--description-font-size);
    transition: all 0.3s ease;
    opacity: 1;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
}

.message-container.error-message {
    background-color: #ffebee;
    color: var(--error-color);
    border-color: var(--error-color);
}

.message-container.success-message {
    background-color: #e8f5e9;
    color: var(--success-color);
    border-color: var(--success-color);
}

.field-error {
    color: var(--error-color);
    font-size: var(--description-font-size);
    margin-top: 4px;
}

.input-error {
    border-color: var(--error-color);
}

.already-logged-in {
    width: 100%;
    max-width: var(--input-width);
    padding: 12px;
    font-family: var(--font-family);
    font-size: var(--input-font-size);
    text-align: center;
}

/* Terms agreement styling */
.terms-agreement {
    width: 100%;
    max-width: var(--input-width);
    margin-top: 20px;
    text-align: center;
    word-wrap: break-word;
}

.terms-agreement p {
    font-family: var(--font-family);
    font-size: var(--disclaimer-font-size);
    line-height: var(--input-line-height);
    color: var(--text-color);
    margin-bottom: 0;
}

.terms-link {
    color: var(--link-color);
    transition: opacity var(--transition-speed) ease;
}

.terms-link:hover {
    opacity: 0.8;
}

/* Signup prompt styling */
.signup-prompt {
    width: 100%;
    max-width: var(--input-width);
    text-align: center;
    font-family: var(--font-family);
    font-size: var(--input-font-size);
    color: var(--text-color);
}

.signup-prompt span,
.sign-up-link {
    white-space: nowrap;
}

.sign-up-link {
    color: var(--link-color);
    font-weight: var(--medium-weight);
    transition: opacity var(--transition-speed) ease;
}

.sign-up-link:hover {
    opacity: 0.8;
}

/* Add a subtle animation for the message container */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-container {
    animation: messageAppear 0.3s ease forwards;
}

/* Reset Password specific styling */
.reset-instructions {
    font-family: var(--font-family);
    font-size: var(--description-font-size);
    line-height: var(--description-line-height);
    color: var(--text-color);
    margin-bottom: 20px;
}

/* Password strength container - matching registration page */
.password-strength-container {
    width: 100%;
    margin-top: 8px;
}

.strength-bar-container {
    height: 6px;
    background-color: #e1e5eb;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 13px;
    margin-top: 4px;
    display: inline-block;
    color: #727272;
}

/* Strength classes - matching registration page */
.strength-weak .strength-bar {
    width: 25%;
    background-color: var(--error-color);
}

.strength-weak .strength-text span {
    color: var(--error-color);
}

.strength-medium .strength-bar {
    width: 50%;
    background-color: var(--warning-color);
}

.strength-medium .strength-text span {
    color: #c79100;
}

.strength-strong .strength-bar {
    width: 75%;
    background-color: var(--success-color);
}

.strength-strong .strength-text span {
    color: var(--success-color);
}

.strength-very-strong .strength-bar {
    width: 100%;
    background-color: var(--very-strong-color);
}

.strength-very-strong .strength-text span {
    color: var(--very-strong-color);
}

/* Password requirements - updated to match registration page */
.password-requirements-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-speed) ease,
        opacity var(--transition-speed) ease, margin var(--transition-speed) ease;
    margin: 0;
}

.password-requirements-wrapper.visible {
    max-height: 300px;
    opacity: 1;
    margin-top: 12px;
}

.password-requirements {
    background-color: #f7f9fc;
    border: 1px solid #e1e5eb;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 13px;
    max-height: none;
    overflow: visible;
    opacity: 1;
    margin: 0;
}

.password-requirements h4 {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-weight: var(--medium-weight);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.requirement-met {
    color: var(--success-color);
    position: relative;
    padding-left: 22px;
}

.requirement-met::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.requirement-not-met {
    color: var(--error-color);
    position: relative;
    padding-left: 22px;
}

.requirement-not-met::before {
    content: "✕";
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Password feedback - updated with animation */
.password-feedback-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-speed) ease,
        opacity var(--transition-speed) ease, margin var(--transition-speed) ease;
    margin: 0;
}

.password-feedback-wrapper.visible {
    max-height: 30px;
    opacity: 1;
    margin-top: 8px;
}

.password-feedback {
    font-family: var(--font-family);
    font-size: var(--description-font-size);
    margin-top: 8px;
    min-height: 18px;
}

/* Password validation statuses */
.password-valid {
    color: var(--success-color);
}

.password-invalid {
    color: var(--error-color);
}

/* Reset link styling */
.reset-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: var(--medium-weight);
    transition: opacity var(--transition-speed) ease;
}

.reset-link:hover {
    opacity: 0.8;
}

/* Password strength wrapper - added from registration page */
.password-strength-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-speed) var(--ease-accelerate),
        opacity var(--transition-speed) var(--ease-accelerate),
        margin var(--transition-speed) var(--ease-accelerate);
    margin: 0;
}

.password-strength-wrapper.visible {
    max-height: 40px;
    opacity: 1;
    margin-top: 8px;
}

/* Media queries */
@media (max-width: 400px) {
    :root {
        --input-padding-horizontal: 10px;
        --input-font-size: 12px;
    }

    .page-title {
        font-size: 28px;
    }

    .login-container {
        padding: 15px;
    }

    .form-container {
        padding: 20px 20px;
    }

    .account-title {
        font-size: 28px;
        line-height: 32px;
    }

    .form-links {
        flex-direction: column;
        align-items: center;
    }

    .separator {
        display: none;
    }
}

@media (max-width: 320px) {
    .login-container {
        padding: 10px;
    }

    .form-container {
        padding: 15px 10px;
    }

    .account-title {
        font-size: 24px;
        line-height: 28px;
    }

    .form-label {
        font-size: 14px;
    }

    .login-options {
        font-size: 12px;
        gap: 12px;
    }
}