/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    background: linear-gradient( 120deg, #f7fbff 0%, #eef6ff 48%, #dfeeff 100%);
    color: #111;
    background-image: url(../img/login/loginBg.png);
    background-size: cover;
}


/* =========================================================
   MAIN PAGE
========================================================= */

.login-page {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 42%) minmax(0, 58%);
    overflow: hidden;
    position: relative;
    background: radial-gradient( circle at 10% 50%, rgba(106, 177, 255, 0.20), transparent 28%), radial-gradient( circle at 90% 15%, rgba(170, 210, 255, 0.28), transparent 32%);
}


/* =========================================================
   BACKGROUND DECORATION
========================================================= */

.login-page::before {
    content: "";
    position: absolute;
    left: -8%;
    bottom: -25%;
    width: 65%;
    height: 55%;
    border-radius: 50%;
    background: radial-gradient( ellipse, rgba(125, 190, 255, 0.25), transparent 68%);
    pointer-events: none;
}

.login-page::after {
    content: "";
    position: absolute;
    right: -12%;
    bottom: -20%;
    width: 70%;
    height: 45%;
    border-radius: 50%;
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    transform: rotate(-7deg);
    pointer-events: none;
}


/* =========================================================
   LEFT SECTION
========================================================= */

.login-section {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3.5vh, 50px) clamp(18px, 4vw, 70px);
    position: relative;
    z-index: 2;
}


/* =========================================================
   LOGIN CARD
========================================================= */

.login-card {
    width: min(100%, 540px);
    height: min(92dvh, 840px);
    min-height: 0;
    background: rgba(255, 255, 255, 0.94);
    border-radius: clamp(18px, 2vw, 28px);
    padding: clamp(25px, 3.2vw, 60px) clamp(25px, 3.5vw, 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 18px 50px rgba(74, 122, 174, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.9);
}


/* =========================================================
   LOGO
========================================================= */

.logo-area {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(18px, 4vh, 50px);
}

.company-logo {
    display: block;
    width: clamp(170px, 100%, 390px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}


/* =========================================================
   WELCOME
========================================================= */

.welcome-area {
    margin-bottom: clamp(18px, 3vh, 34px);
}

.welcome-area h1 {
    font-size: clamp(28px, 1.8vw, 40px);
    line-height: 1.1;
    font-weight: 700;
    /* margin-bottom: clamp(5px, 1vh, 12px); */
}

.welcome-area p {
    font-size: clamp(14px, .8vw, 18px);
    line-height: 1.5;
    color: #888;
}


/* =========================================================
   FORM
========================================================= */

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: clamp(15px, 2.3vh, 26px);
}

.form-group label {
    display: block;
    font-size: clamp(15px, 1.05vw, 19px);
    /* font-weight: 700; */
    color: #353535;
    margin-bottom: clamp(7px, 1vh, 12px);
}


/* =========================================================
   INPUT
========================================================= */

.input-wrapper {
    width: 100%;
    height: clamp(52px, 6vh, 68px);
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    border: 1px solid #c8c8c8;
    border-radius: clamp(9px, 1vw, 13px);
    background: #fff;
    outline: none;
    padding: 0 clamp(48px, 4vw, 62px);
    font-family: inherit;
    font-size: clamp(14px, 1vw, 17px);
    /* font-weight: 600; */
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #aaa;
    opacity: 1;
}

.input-wrapper input:focus {
    border-color: #4a7ff0;
    box-shadow: 0 0 0 3px rgba(74, 127, 240, 0.10);
}


/* =========================================================
   INPUT ICON
========================================================= */

.input-icon {
    position: absolute;
    left: clamp(15px, 1.5vw, 20px);
    top: 50%;
    transform: translateY(-50%);
    width: clamp(19px, 1.4vw, 25px);
    height: clamp(19px, 1.4vw, 25px);
    color: #999;
    pointer-events: none;
    z-index: 2;
    font-size: clamp(12px, 1.3rem, 24px);
}

.input-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}


/* =========================================================
   PASSWORD TOGGLE
========================================================= */

.password-toggle {
    position: absolute;
    right: clamp(14px, 1.4vw, 23px);
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #999;
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   REMEMBER / FORGOT
========================================================= */

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: clamp(-3px, -0.3vh, 0px);
    margin-bottom: clamp(18px, 2.8vh, 30px);
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #3d3d3d;
    font-size: clamp(13px, 0.95vw, 17px);
    font-weight: 600;
    white-space: nowrap;
}

.remember input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkmark {
    width: clamp(20px, 1.5vw, 25px);
    height: clamp(20px, 1.5vw, 25px);
    border: 1px solid #c9c9c9;
    border-radius: 2px;
    background: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.remember input:checked+.checkmark {
    background: #4279e8;
    border-color: #4279e8;
}

.remember input:checked+.checkmark::after {
    content: "✓";
    color: white;
    font-size: 15px;
    font-weight: 700;
}

.forgot-link {
    color: #3978ee;
    text-decoration: none;
    font-size: clamp(13px, 0.95vw, 17px);
    font-weight: 700;
    white-space: nowrap;
}

.forgot-link:hover {
    text-decoration: underline;
}


/* =========================================================
   SIGN IN BUTTON
========================================================= */

.signin-btn {
    width: 100%;
    height: clamp(52px, 6.5vh, 70px);
    border: 0;
    border-radius: clamp(9px, 1vw, 13px);
    background: linear-gradient( 135deg, #4b80ed, #3f75e4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1vw, 16px);
    cursor: pointer;
    font-family: inherit;
    font-size: clamp(18px, 1.4vw, 25px);
    font-weight: 600;
    box-shadow: 0 5px 12px rgba(64, 117, 225, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(64, 117, 225, 0.25);
}

.signin-btn:active {
    transform: translateY(0);
}

.button-lock {
    width: clamp(20px, 1.5vw, 27px);
    height: clamp(20px, 1.5vw, 27px);
    display: flex;
}

.button-lock svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}


/* =========================================================
   CONTACT ADMIN
========================================================= */

.contact-admin {
    margin-top: clamp(18px, 3vh, 32px);
    text-align: center;
    font-size: clamp(12px, 0.9vw, 16px);
    color: #727272;
    font-weight: 600;
    line-height: 1.5;
}

.contact-admin a {
    color: #3277ef;
    text-decoration: none;
    font-weight: 700;
}

.contact-admin a:hover {
    text-decoration: underline;
}


/* =========================================================
   RIGHT HERO SECTION
========================================================= */

.hero-section {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 80px);
    position: relative;
    z-index: 1;
}

.hero-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(10px, 2vw, 35px);
}

.hero-content h2 {
    font-size: clamp(27px, 2.5vw, 48px);
    line-height: 1.18;
    font-weight: 700;
    color: #080808;
    margin-bottom: clamp(12px, 1vh, 14px);
}

.hero-content p {
    font-size: clamp(13px, 1vw, 18px);
    line-height: 1.55;
    color: #929292;
    /* font-weight: 600; */
    margin-bottom: clamp(10px, 2vh, 25px);
}


/* =========================================================
   HERO IMAGE
========================================================= */

.hero-image {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    display: block;
    width: min(100%, 760px);
    max-width: 100%;
    max-height: 65dvh;
    height: auto;
    object-fit: contain;
}


/* =========================================================
   LARGE LAPTOP
========================================================= */

@media (max-width: 1200px) {
    .login-page {
        grid-template-columns: minmax(340px, 45%) minmax(0, 55%);
    }
    .login-section {
        padding: 25px;
    }
    .hero-section {
        padding: 25px;
    }
    .hero-content {
        padding: 10px;
    }
    .hero-content h2 {
        font-size: clamp(25px, 3vw, 40px);
    }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {
    .login-page {
        grid-template-columns: minmax(320px, 48%) minmax(0, 52%);
    }
    .login-section {
        padding: 20px;
    }
    .hero-section {
        padding: 20px;
    }
    .login-card {
        height: min(94dvh, 760px);
        padding: 30px;
    }
    .hero-content h2 {
        font-size: clamp(23px, 3.5vw, 34px);
    }
    .hero-content p {
        font-size: 13px;
    }
    .desktop-break {
        display: none;
    }
}


/* =========================================================
   SMALL TABLET / MOBILE LANDSCAPE
========================================================= */

@media (max-width: 700px) {
    body {
        overflow: hidden;
    }
    .login-page {
        display: block;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
    }
    /* Hide right illustration on small screens */
    .hero-section {
        display: none;
    }
    .login-section {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        padding: clamp(10px, 3vw, 20px);
    }
    .login-card {
        width: 100%;
        max-width: 620px;
        height: calc(100dvh - clamp(20px, 6vw, 40px));
        max-height: none;
        padding: clamp(18px, 5vw, 35px);
        border-radius: clamp(15px, 4vw, 25px);
        justify-content: center;
        overflow: hidden;
    }
    .logo-area {
        margin-bottom: clamp(12px, 2vh, 20px);
    }
    .company-logo {
        width: clamp(155px, 55%, 280px);
    }
    .welcome-area {
        margin-bottom: clamp(14px, 2vh, 22px);
    }
    .welcome-area h1 {
        font-size: clamp(25px, 7vw, 34px);
    }
    .welcome-area p {
        font-size: clamp(12px, 3.5vw, 15px);
    }
    .form-group {
        margin-bottom: clamp(12px, 2vh, 18px);
    }
    .form-group label {
        font-size: clamp(14px, 3.8vw, 17px);
    }
    .input-wrapper {
        height: clamp(46px, 7vh, 58px);
    }
    .login-options {
        margin-bottom: clamp(14px, 2.5vh, 22px);
    }
    .signin-btn {
        height: clamp(47px, 7vh, 58px);
        font-size: clamp(17px, 4.5vw, 21px);
    }
    .contact-admin {
        margin-top: clamp(13px, 2vh, 20px);
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 430px) {
    .login-section {
        padding: 8px;
    }
    .login-card {
        height: calc(100dvh - 16px);
        padding: 18px 20px;
    }
    .company-logo {
        width: 58%;
    }
    .welcome-area h1 {
        font-size: 26px;
    }
    .welcome-area p {
        font-size: 12px;
    }
    .form-group label {
        font-size: 14px;
    }
    .input-wrapper {
        height: 48px;
    }
    .input-wrapper input {
        font-size: 13px;
    }
    .remember,
    .forgot-link {
        font-size: 12px;
    }
    .signin-btn {
        height: 50px;
        font-size: 18px;
    }
    .contact-admin {
        font-size: 11px;
    }
}


/* =========================================================
   VERY SHORT SCREEN
   Prevent vertical overflow on short laptops/mobile
========================================================= */

@media (max-height: 650px) {
    .login-card {
        padding-top: 15px;
        padding-bottom: 15px;
    }
    .logo-area {
        margin-bottom: 20px;
    }
    .company-logo {
        width: clamp(140px, 100%, 300px);
    }
    .welcome-area {
        margin-bottom: 12px;
    }
    .welcome-area h1 {
        font-size: clamp(23px, 2vw, 30px);
    }
    .form-group {
        margin-bottom: 10px;
    }
    .input-wrapper {
        height: 46px;
    }
    .login-options {
        margin-bottom: 12px;
    }
    .signin-btn {
        height: 40px;
    }
    .contact-admin {
        margin-top: 10px;
    }
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(55, 120, 239, 0.25);
    outline-offset: 2px;
}


/***********************
 ***** Custom Code  ****
 ***********************/

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;

    width: 100%;
    margin-bottom: 20px;
    padding: 12px 15px;

    background: #fff1f2;
    border: 1px solid #f5c2c7;
    border-left: 4px solid #dc3545;

    border-radius: 6px;

    color: #842029;
    font-size: 14px;
    line-height: 1.5;

    box-sizing: border-box;
}

.login-error i {
    font-size: 18px;
    flex-shrink: 0;
}

.field-error {
    display: none;
    margin-top: 6px;
    padding-left: 2px;
    color: #dc3545;
    font-size: 13px;
    line-height: 1.4;
}

.input-error {
    border-color: #dc3545 !important;
}

.input-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.10);
}

.input-error + .field-error {
    display: block;
}

/* =========================================================
   CAPTCHA
   ========================================================= */

.captcha-group {
    width: 100%;
}

.captcha-control {
    width: 100%;
    height: 46px;

    display: flex;
    align-items: stretch;

    border: 1px solid #cfd2d8;
    border-radius: 13px;

    background: #ffffff;

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* CAPTCHA image area */

.captcha-image-box {
    width: 145px;
    min-width: 145px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f7f8fa;

    border-right: 1px solid #e1e3e7;
}

.captcha-image-box img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    user-select: none;
}


/* CAPTCHA text input */

.captcha-control .captcha-input {
    flex: 1;
    min-width: 0;

    height: 100%;

    padding: 0 12px;

    border: 0 !important;
    outline: 0 !important;

    background: transparent;

    font-size: 14px;
    font-family: inherit;

    color: #333333;

    text-transform: uppercase;
    letter-spacing: 1px;

    box-shadow: none !important;
}

.captcha-control .captcha-input::placeholder {
    color: #9ba0a8;
    letter-spacing: normal;
    text-transform: none;
}


/* Refresh button */

.captcha-refresh {
    width: 46px;
    min-width: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-left: 1px solid #e1e3e7;

    background: transparent;

    color: #8c929b;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.captcha-refresh i {
    font-size: 22px;
}

.captcha-refresh:hover {
    background: #f5f7fa;
    color: #477bea;
}

.captcha-refresh:focus {
    outline: none;
}


/* Focus entire CAPTCHA box */

.captcha-control:focus-within {
    border-color: #477bea;

    box-shadow:
        0 0 0 3px rgba(71, 123, 234, 0.10);
}


/* Validation */

.captcha-control.has-error {
    border-color: #dc3545;
}

.captcha-control.has-error:focus-within {
    border-color: #dc3545;

    box-shadow:
        0 0 0 3px rgba(220, 53, 69, 0.10);
}

.captcha-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-success {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 6px;
    background: #e8f7ee;
    border: 1px solid #b7e4c7;
    color: #198754;
    font-size: 14px;
}

.login-success i {
    font-size: 18px;
}