/* Global Styles */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Roboto', Helvetica, Arial, serif;
    background-color: #f8f8f8;
    color: #6e6b7b;
    line-height: 1.45;
    font-size: 1rem;
    font-weight: 400;
}

/* Background Handling - Matches id.ezcloud.vn .login-page */
.login-page {
    background-image: url("https://id.ezcloud.vn/images/Frame.svg"), linear-gradient(125.92deg, #020C59 9.05%, #1A4F96 100%);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    /* Desktop default */
    background-attachment: fixed;
}

/* Mobile Background Adjustment */
@media (max-width: 768px) {
    .login-page {
        background-size: auto;
        /* Allow pattern to flow naturally on smaller screens */
        background-position: 50% 50%;
    }
}

h4 {
    font-weight: 500;
    font-size: 1.286rem;
    color: #5e5873;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

a {
    color: #7367f0;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: #5e50ee;
}

.text-secondary {
    color: #b9b9c3 !important;
}

/* Utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-start {
    justify-content: flex-start;
}

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

.w-100 {
    width: 100%;
}

.mt-2 {
    margin-top: 1.5rem !important;
}

.mt-1 {
    margin-top: 1rem !important;
}

.mb-1 {
    margin-bottom: 1rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mx-1 {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

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

.ms-1 {
    margin-left: 0.5rem;
}

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

.px-2 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.my-2 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

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

/* Wrapper */
.app-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    display: flex;
    flex-basis: 100%;
    min-height: 100vh;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.auth-inner {
    max-width: 400px;
    width: 100%;
    position: relative;
}

/* Card */
.card {
    border: none;
    box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    border-radius: 0.428rem;
    background-color: #fff;
    margin-bottom: 0;
    /* Removing bottom margin to sit flush with footer content */
}

.card-body {
    padding: 2rem;
}

.brand-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Form Controls */
.form-label {
    color: #5e5873;
    font-size: 0.857rem;
    margin-bottom: 0.2857rem;
    display: block;
}

.form-control {
    background-color: #fff;
    border: 1px solid #d8d6de;
    color: #6e6b7b;
    border-radius: 0.357rem;
    padding: 0.571rem 1rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #6e6b7b;
    background-color: #fff;
    border-color: #7367f0;
    outline: 0;
    box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);
}

/* Input Group Merge (Exact Replica) */
.input-group {
    position: relative;
    display: flex;
    width: 100%;
}

.input-group-merge .form-control:not(:last-child) {
    border-right: 0;
    padding-right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-merge .input-group-text {
    background-color: #fff;
    border: 1px solid #d8d6de;
    border-left: 0;
    border-radius: 0.357rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0.571rem 1rem;
    /* Match input padding */
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #6e6b7b;
}

/* Merging Effect: Hover/Focus */
.input-group-merge:focus-within .form-control,
.input-group-merge:focus-within .input-group-text {
    border-color: #7367f0;
    box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);
    /* Optional: add shadow to both */
}

.input-group-merge:focus-within {
    box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);
    border-radius: 0.357rem;
}

/* Checkbox */
.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.785rem;
    margin-bottom: 0.125rem;
}

.form-check-input {
    float: left;
    margin-left: -1.785rem;
    width: 1.143rem;
    height: 1.143rem;
    margin-top: 0.17rem;
    background-color: #fff;
    border: 1px solid #d8d6de;
    border-radius: 0.25em;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.form-check-input:checked {
    background-color: #7367f0;
    border-color: #7367f0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

/* Button */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1;
    color: #6e6b7b;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.786rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.358rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    border-color: #114A9F;
    background-color: #114A9F;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0d3878;
    border-color: #0d3878;
    box-shadow: 0 8px 25px -8px #114A9F;
}

.btn-outline-primary {
    color: #114A9F;
    border-color: #114A9F;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: rgba(17, 74, 159, 0.04);
}

/* Divider */
.divider {
    display: block;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    margin: 1rem 0;
}

.divider .divider-text {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    font-size: 0.85rem;
    color: #6e6b7b;
}

.divider .divider-text:before,
.divider .divider-text:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9999px;
    height: 1px;
    background-color: #ebe9f1;
}

.divider .divider-text:after {
    left: 100%;
}

.divider .divider-text:before {
    right: 100%;
}

/* Language Switcher */
.dropdown {
    position: relative;
}

.btn-flat-secondary {
    background-color: transparent;
    color: #b9b9c3;
    /* Matches text-secondary */
    border: none;
    padding: 11px 10px;
    /* Adjusted padding */
}

.btn-flat-secondary:hover {
    color: #7367f0;
}

.btn-flat-secondary:focus {
    outline: none;
    box-shadow: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    /* Opens upwards */
    left: 0;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: 0.358rem;
    box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.65rem 1.28rem;
    clear: both;
    font-weight: 400;
    color: #6e6b7b;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover {
    color: #7367f0;
    background-color: rgba(115, 103, 240, 0.12);
}

.small {
    font-size: 80%;
}