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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
}

body {
    background-color: #F5F5FA;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -1;
}

.login-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
    /*padding: 20px;*/
    overflow: hidden;
}

.login-container {
    display: flex;
    flex-direction: column;

    align-items: center;
    padding: 0;
    position: relative;
    width: 100%;
    max-width: 926px;
    min-height: 1029px;
    margin: 0 auto;
    overflow: hidden;
}

.trong-dong-bg {
    position: absolute;
    width: 926px;
    height: 929px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
    object-fit: contain;
}

.login-header {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.login-header img {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 25px;
    font-weight: bolder;
    color: #013A5D;
    margin: 0;
    letter-spacing: 0;
    font-family: "Merriweather", serif;
}

.login-header p {
    font-size: 16px;
    color: #026DAF;
    margin: 8px 0 0 0;
    font-weight: 500;
}

.login-box {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px 30px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
    margin: 0 auto;
    align-items: stretch;
}

.login-box h2 {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 500; /* Medium */
    font-style: normal;
    font-size: 24px; /* per spec */
    line-height: 150%; /* 1.5 */
    letter-spacing: 0;
    color: #000000;
    margin: 0 auto; /* top spacing handled by gap */
}

.form-group {
    margin: 10px 0; /* gaps handled by container gap */
    width: 100%;
}

.form-group label {
    display: block;
    font-family: 'Inter', sans-serif; /* per spec */
    font-weight: 700; /* Bold */
    font-style: normal;
    font-size: 14px; /* per spec */
    line-height: 150%;
    vertical-align: middle;
    color: #000000;
    margin-bottom: 3px;
}

.form-group label .required {
    color: #E53935;
}

.form-group input {
    width: 100%;
    height: 40px; /* per spec */
    padding: 8px 12px;
    border: 1px solid #98A2B3; /* per spec */
    border-radius: 8px; /* per spec */
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box; /* ensure padding counted in width */
    display: block;
}

.form-group input::placeholder {
    color: #98A2B3; /* per spec */
}

.form-group input:focus {
    outline: none;
    border-color: #026DAF;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(2, 109, 175, 0.08);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.password-toggle:hover {
    opacity: 0.7;
}

.password-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
    transition: opacity 0.2s ease;
}

.password-toggle .eye-icon {
    display: none;
}

.password-toggle .eye-slash-icon {
    display: block;
}


.password-toggle.show-password .eye-icon {
    display: block;
}

.password-toggle.show-password .eye-slash-icon {
    display: none;
}

.forgot-password {
    text-align: right;
    margin: 10px;
}

.forgot-password a {
    font-size: 14px;
    color: #026DAF;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.forgot-password a:hover {
    color: #1A94FF;
    text-decoration: underline;
}

.btn-login {
    /* full width button: fill the login-box inner width (respects padding) */
    display: block;
    width: 100%; /* fill available width */
    height: 43px;
    padding: 8px 12px;
    background-color: #026DAF;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-sizing: border-box;
}

/* Make hover affect the whole button (background + text) instead of only text color */
.btn-login:hover {
    background-color: #015C9A; /* slightly darker blue on hover */
    color: #FFFFFF; /* keep text white for contrast */
    text-decoration: none;
}

.btn-login:active {
    transform: scale(0.98);
}

.register-link {
    text-align: center;

}

.register-link a {
    font-size: 15px;
    color: #026DAF;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.divider {
    display: none; /* keep for backward compatibility, using divider-row instead */
}

/* Divider: text centered with short lines on each side */
.divider-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* reduced space between lines and text to save vertical room */
    width: 100%;

}

/* Each side line is short; reduce vertical footprint */
.divider-row .divider-line {
    flex: 1;
    max-width: 100%;
    height: 1px;
    background: #EBEBF0;
    border-radius: 1px;
    margin: 0;
}

.divider-row .divider-text {
    font-size: 13px;
    color: #808089;
    font-weight: 500;
    padding: 0 6px; /* tighten horizontal padding */
    white-space: nowrap;
    background: transparent;
    line-height: 1; /* ensure minimal vertical height */
}

.alt-divider-row {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    margin: 6px 0; /* reduce vertical gap */
}

.alt-divider-row .alt-divider-line {
    flex: 1;
    height: 1px;
    background: #D0D5DD;
    margin: 0;
}

.social-login {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    margin: 8px 0 12px 0;
    width: 100%;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    cursor: pointer;
    width: auto;
    flex: 1;
    min-width: 150px;
    max-width: 180px;
}

.social-icon img {
    width: 60px; /* per spec */
    height: 60px; /* per spec */
    opacity: 1;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: box-shadow 0.3s ease;
    object-fit: cover;
}

.social-icon-text {
    font-family: 'Inter', sans-serif; /* per spec */
    font-weight: 400; /* Regular */
    font-style: normal;
    font-size: 12px; /* per spec */
    line-height: 150%; /* 1.5 */
    text-align: center;
    color: #27272A;
    width: 100%;
    word-break: break-word;
}

.alt-login {
    text-align: center;
    margin-top: 6px;
}

.alt-login a {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 500; /* Medium */
    font-style: normal;
    font-size: 14px; /* per spec */
    line-height: 150%;
    text-align: center;

    color: #1A94FF !important;
    border-radius: 6px;
    text-decoration: none;
}

.alt-login a:focus {
    outline: 2px solid rgba(26, 148, 255, 0.2);
}

.alert-error {

    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    .login-box {
        padding: 35px 25px;
        max-width: 100%;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .login-header p {
        font-size: 14px;
    }

    .social-login {
        gap: 15px;
    }

    .social-icon img {
        width: 56px;
        height: 56px;
    }

    .social-icon-text {
        font-size: 10px;
    }
}

/* hide footer-top (buttons) only on login page; keep footer-bottom contact visible */
.owner-login footer .footer-top {
    display: none !important;
}

/* Tablet devices (BS3: min-width 768px) */
@media (max-width: 991px) {
    .login-box {
        padding: 35px 25px !important;
        max-width: 90% !important;
    }
    .login-header h1 {
        font-size: 24px;
    }
    .login-header p {
        font-size: 14px;
    }
    .social-login {
        gap: 15px !important;
    }
    .social-icon {
        flex: 1 1 auto;
        min-width: 150px;
    }
    .social-icon img {
        width: 52px;
        height: 52px;
    }
    .social-icon-text {
        font-size: 11px;
    }
}

/* Small devices (BS3: max-width 767px) - Tablet/Small Mobile */
@media (min-width: 481px) and (max-width: 767px) {
    .login-wrapper {

        overflow-x: hidden !important;
        width: 100% !important;
    }

    .login-container {
        min-height: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
        height: auto !important;
    }

    .trong-dong-bg {
        width: 926px !important;
        height: 929px !important;
    }

    .login-header {
        text-align: center;
        margin-bottom: 12px !important;
    }

    .login-header img {
        width: 60px !important;
        height: auto !important;
        margin-bottom: 12px !important;
    }

    .login-header h1,
    .login-header p {
        font-size: inherit !important;
    }

    .login-box {
        padding: 25px 18px !important;
        gap: 12px !important;
        margin: 20px 10px 106px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .login-box h2 {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }

    .form-group {
        margin: 4px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .form-group label {
        font-size: 13px !important;
        margin-bottom: 2px !important;
    }

    .form-group input {
        height: 36px !important;
        font-size: 13px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .password-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .btn-login {
        height: 38px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
    }

    .forgot-password {
        margin: 8px 0 !important;
        width: 100% !important;
    }

    .forgot-password a {
        font-size: 12px;
    }

    .divider-row {
        gap: 4px !important;
        margin: 10px 0 !important;
    }

    .divider-row .divider-text {
        font-size: 11px;
        padding: 0 4px;
    }

    .social-login {
        gap: 8px !important;
        margin: 10px 0 !important;
        justify-content: space-between;
        width: 100% !important;
    }

    .social-icon {
        flex: 1 1 auto;
        min-width: 0 !important;
        max-width: calc(33.333% - 6px) !important;
    }

    .social-icon img {
        width: 44px;
        height: 44px;
    }

    .social-icon-text {
        font-size: 9px;
        line-height: 130%;
    }

    .register-link {
        width: 100% !important;
        max-width: 100% !important;
    }

    .register-link a {
        font-size: 13px;
    }

    .alt-login {
        width: 100% !important;
    }

    .alt-login a {
        font-size: 12px;
    }
}

/* Extra small devices (BS3: max-width 480px - phones, 390px width) */
@media (max-width: 480px) {
    .login-wrapper {

        overflow-x: hidden !important;
        width: 100% !important;
        min-height: 100vh !important;
    }

    .login-container {
        min-height: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
        height: auto !important;
    }

    .trong-dong-bg {
        width: 926px !important;
        height: 929px !important;
    }

    .login-header {
        margin-bottom: 8px !important;
        text-align: left !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box;
        margin-left: 20px;
        padding: 10px 0 !important;
    }

    .login-header img {
        width: 45px !important;
        height: auto !important;
        margin: 0 !important;
        flex: 0 0 auto;
    }

    .login-header-title {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        gap: 0 !important;
    }

    .login-header h1 {
        margin: 0 !important;
        font-size: 18px !important;
        line-height: 1.3 !important;
    }

    .login-header p {
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    .login-box {
        padding: 20px 12px !important;
        gap: 10px !important;
        width: calc(100% - 20px) !important;
        margin-bottom: 106px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .login-box h2 {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }

    .form-group {
        margin: 4px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .form-group label {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin-bottom: 2px !important;
    }

    .form-group input {
        height: 36px !important;
        font-size: 13px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 6px 10px !important;
    }

    .password-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .password-toggle {
        right: 10px;
        width: 28px;
        height: 28px;
    }

    .password-toggle svg {
        width: 18px;
        height: 18px;
    }

    .btn-login {
        height: 36px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 6px 12px !important;
        margin: 10px 0 !important;
    }

    .forgot-password {
        margin: 4px 0 !important;
        width: 100% !important;
    }

    .forgot-password a {
        font-size: 12px;
    }

    .divider-row {
        margin: 8px 0 !important;
        gap: 4px !important;
    }

    .divider-row .divider-text {
        font-size: 10px;
        padding: 0 3px;
    }

    .social-login {
        margin: 8px 0 !important;
        gap: 6px !important;
        justify-content: space-between;
        width: 100% !important;
    }

    .social-icon {
        flex: 1 1 auto;
        min-width: 0 !important;
        max-width: calc(33.333% - 4px) !important;
        margin-bottom: 0;
    }

    .social-icon img {
        width: 40px;
        height: 40px;
        margin-bottom: 4px;
    }

    .social-icon-text {
        font-size: 8px;
        line-height: 120%;
    }

    .alt-login {
        margin-top: 10px;
        width: 100% !important;
    }

    .register-link {
        margin-bottom: 10px;
        width: 100% !important;
        max-width: 100% !important;
    }

    .register-link a {
        font-size: 13px;
        line-height: 1.4;
    }
}
