html {
    font-size: 16px;
}

body {
    margin: 0;
    overflow-x: hidden;
}

/* Auth Layout */
.auth-layout {
    display: flex;
    background: linear-gradient(180deg, #EBF8FF 0%, #F3ECFF 100%);
    padding: 1.25rem;
    font-family: 'Basier Square', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
}

.auth-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 6.25rem;
    border-bottom-right-radius: 6.25rem;
    background-color: transparent;
    height: calc(100vh - 2.5rem);
    overflow: hidden;
}

.auth-image img {
    height: calc(100vh - 2.5rem);
    object-fit: cover;
    object-position: center;
    display: block;
    border-top-left-radius: 6.25rem;
    border-bottom-right-radius: 6.25rem;
    opacity: 1;
}

@media (max-width: 768px) {
    .auth-layout {
        flex-direction: column;
        padding: 1rem;
    }

    .auth-content {
        padding: 1rem;
    }

    .auth-image {
        display: none;
    }
}

/* Auth Container */
.home-auth-container {
    width: 100%;
    max-width: 22.5rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    font-family: 'Basier Square', sans-serif;
}

.home-auth-content {
    text-align: center;
}

/* Logo Section */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.75rem;
    height: 2.5rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    opacity: 1;
}

.app-title {
    font-weight: 400;
    font-size: 1.125rem;
    vertical-align: middle;
    margin: 0;
    color: #353D4C;
    line-height: 1.5rem;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 1.5rem;
}

.welcome-title {
    font-weight: 600;
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 0.75rem;
    margin-top: 0;
    line-height: 2.75rem;
    color: #2A2D33;
}

.welcome-subtitle {
    font-size: 1rem;
    color: #585F69;
    margin: 0 0 2rem 0;
    font-weight: 400;
    line-height: 1.5rem;
}

/* Auth Form */
.auth-form {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #1f2937;
    line-height: 1.25rem;
}

/* Input Container */
.input-container {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    z-index: 1;
    opacity: 0.6;
}

.input-toggle {
    position: absolute;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    z-index: 1;
    cursor: pointer;
    opacity: 0.6;
}

.input-error-icon {
    position: absolute;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    z-index: 1;
    opacity: 1;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid #D6D6D6;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
    background: #FEFEFE !important;
    font-weight: 400;
    line-height: 1.375rem;
    font-family: 'Basier Square', sans-serif;
}

.form-control.password {
    padding: 0.625rem 2.5rem 0.625rem 0.75rem;
!important
}

.form-control::placeholder {
    color: #BDBDBD;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 0.1875rem rgba(99, 102, 241, 0.1);
}

.form-control.error,
.form-control.input-validation-error {
    border-color: #B60000;
}

.form-control.error:focus,
.form-control.input-validation-error:focus {
    outline: none;
    border-color: #B60000;
    box-shadow: 0 0 0 0.1875rem rgba(182, 0, 0, 0.1);
}

/* Input Hints and Validation */
.input-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0;
    display: none;
}

.input-hint.error {
    color: #B60000;
    display: block;
}

.field-validation-error {
    font-size: 0.75rem;
    color: #B60000;
    display: block;
    margin-top: 0.25rem;
}

.field-validation-valid {
    display: none;
}

.input-hint.hidden {
    display: none;
}

/* Form Check Row */
.form-check-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    line-height: 1.25rem;
}

.form-check {
    display: flex;
    align-items: center;
}

.aibase-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1px solid #D6D6D6;
    border-radius: 0.25rem;
    cursor: pointer;
    outline: none;
    background: transparent no-repeat center;
    margin: 0;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.aibase-checkbox:checked {
    background-color: #4D6CE7;
    border-color: #4D6CE7;
    background-image: url('/_content/AIBase.UI.Common/icons/files/checkbox-tick.svg');
}

.aibase-checkbox.checkbox-header:checked {
    background-image: url('/_content/AIBase.UI.Common/icons/files/checkbox-minus.svg');
}

.aibase-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 0.1875rem rgba(77, 108, 231, 0.1);
}

.aibase-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.form-check-label {
    font-size: 0.875rem;
    color: #585F69;
    font-weight: 400;
    cursor: pointer;
}

.reset-password-link {
    font-weight: 600;
    font-size: 0.875rem;
    color: #4D6CE7;
    text-decoration: none;
}

.reset-password-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-signin {
    background: linear-gradient(269.63deg, #84D6FC 0.05%, #6567F8 71.15%);
    color: #FEFEFE;
    font-weight: 600;
    height: 3rem;
    transition: all 0.25s ease-in-out;
    margin-top: 0.75rem;
}

#login-submit,
#forgot-password-submit {
    margin-top: 0;
}

.btn-signin:hover:not(:disabled) {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(99, 102, 241, 0.3);
}

.btn-signin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-social {
    background-color: #FBFBFB;
    border: 1px solid #E1E4EA;
    color: #2A2D33;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Basier Square', sans-serif;
}

.btn-social img {
    width: 1.5rem !important;
    height: 1.5rem !important;
    filter: none !important;
    opacity: 1 !important;
}

.btn-social:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

.w-100 {
    width: 100%;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Divider */
.or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding-bottom: 1.5rem;
}

.or {
    display: block;
    color: #585F69;
    font-size: 0.875rem;
    font-weight: 400;
    background: transparent;
    text-align: center;
    line-height: 1.25rem;
}

.hr-line {
    border: none;
    border-top: 1px solid #E5E5E5;
    flex: 1;
    margin: 0;
}

/* Social Auth Buttons */
.social-auth-buttons {
    margin-bottom: 1.5rem;
}

.social-auth-buttons .btn {
    margin-bottom: 0.75rem;
}

.social-auth-buttons .btn:last-child {
    margin-bottom: 0;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-footer p {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: #585F69;
    font-weight: 400;
}

.auth-footer a {
    font-weight: 400;
    font-size: 0.875rem;
    color: #4D6CE7;
    text-decoration: underline;
}

.signin-redirect {
    font-weight: 600 !important;
    text-decoration: none !important;
}

.signin-redirect:hover {
    text-decoration: underline !important;
}

/* Terms Text */
.terms-text {
    font-size: 0.75rem !important;
    color: #6b7280 !important;
    margin-top: 1rem !important;
    max-width: 80%;
}

.terms-text a {
    font-size: 0.75rem !important;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* Validation Summary */
.validation-summary-errors {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    background-color: #fef2f2;
    border: 1px solid #B60000;
    color: #B60000;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.validation-summary-valid {
    display: none;
}

/* Button Spinner States */
.button-text,
.button-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Basier Square', sans-serif;
}

.button-spinner {
    gap: 0.5rem;
}

/* Spinner */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
    vertical-align: middle;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.125em;
}

.me-2 {
    margin-right: 0.5rem;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 1440px) {
    html {
        font-size: 16px;
    }
}

@media (max-height: 778px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 1200px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 1024px) {
    html {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .auth-content {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 15px;
    }

    .home-auth-container {
        padding: 0 1rem;
    }

    .auth-content {
        padding: 1rem;
    }
}
