
/* =========================================================
   LOGIN INTERNAL MANAGEMENT
   PT. BPR Pekanbaru Madani (Perseroda)
   File: public/css/login.css
   ========================================================= */

:root {
    --orange: #ff762e;
    --orange-dark: #e95d18;
    --orange-light: #fff0e7;
    --text: #202631;
    --muted: #758092;
    --border: #e4e7ed;
    --white: #ffffff;
    --background: #fbfaf9;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "Public Sans", Arial, sans-serif;
    color: var(--text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

/* =========================================================
   LAYOUT UTAMA
   ========================================================= */

.login-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--white);
}

/* =========================================================
   PANEL KIRI
   ========================================================= */

.login-visual {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--white);

    background-color: #8e431e;
    background-image: url("../gambar/bpr2.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.visual-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;

    background: linear-gradient(
        135deg,
        rgba(92, 40, 17, 0.88) 0%,
        rgba(181, 75, 27, 0.78) 48%,
        rgba(255, 132, 64, 0.57) 100%
    );
}

.visual-content {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    width: 100%;
    min-height: 100%;
    padding: clamp(32px, 5vw, 72px) clamp(28px, 4.5vw, 72px);
}

.visual-message {
    max-width: 650px;
    margin: auto 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.eyebrow-line {
    display: inline-block;
    width: 28px;
    height: 3px;
    flex-shrink: 0;
    border-radius: 5px;
    background: #ffc18e;
}

.visual-message h1 {
    margin: 0 0 20px;
    font-size: clamp(34px, 3.4vw, 60px);
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: -1.7px;
}

.visual-message h1 span {
    display: block;
    color: #ffc18e;
}

.visual-message p {
    max-width: 490px;
    margin: 0;
    font-size: 15px;
    line-height: 1.95;
    color: rgba(255, 255, 255, 0.94);
}

/* =========================================================
   FITUR PANEL KIRI
   ========================================================= */

.visual-features {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 36px;
}

.visual-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;

    color: var(--white);
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    font-size: 17px;
}

.visual-feature strong,
.visual-feature small {
    display: block;
}

.visual-feature strong {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 800;
}

.visual-feature small {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

.visual-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 22px;
    margin-top: 42px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);

    font-size: 10px;
    color: rgba(255, 255, 255, 0.88);
}

/* =========================================================
   PANEL KANAN
   ========================================================= */

.login-form-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px clamp(28px, 5vw, 88px);

    background:
        radial-gradient(
            circle at 100% 0%,
            rgba(255, 232, 216, 0.38),
            transparent 32%
        ),
        var(--white);
}

.login-form-wrapper {
    width: 100%;
    max-width: 430px;
    margin: auto;
}

/* =========================================================
   LOGO RESPONSIF
   Desktop: tampilkan desktop-brand
   Mobile: tampilkan mobile-brand
   ========================================================= */

/* Default desktop: hanya logo desktop yang terlihat */
.mobile-brand {
    display: none !important;
}

.desktop-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto 34px;
}

.desktop-brand a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-decoration: none;
}

.desktop-brand img {
    display: block;
    width: 100%;
    max-width: 400px;
    max-height: 110px;
    height: auto;
    object-fit: contain;
    object-position: center;
}

/* Logo mobile disiapkan, tetapi tersembunyi di desktop */
.mobile-brand a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-decoration: none;
}

.mobile-brand img {
    display: block;
    width: 100%;
    max-width: 280px;
    max-height: 75px;
    height: auto;
    object-fit: contain;
    object-position: center;
}

/* =========================================================
   JUDUL LOGIN
   ========================================================= */

.login-heading {
    margin-bottom: 32px;
}

.login-heading h2 {
    margin: 0 0 12px;
    font-size: clamp(25px, 2vw, 32px);
    font-weight: 850;
    line-height: 1.25;
    letter-spacing: -0.9px;
    color: var(--text);
}

.login-heading p {
    margin: 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
}

/* Sembunyikan logo lama jika masih memakai class ini */
.login-heading .login-icon {
    display: none !important;
}

/* =========================================================
   NOTIFIKASI
   ========================================================= */

.login-form-wrapper .alert {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* =========================================================
   FORM
   ========================================================= */

.login-form-wrapper form {
    width: 100%;
    margin: 0;
}

.form-field {
    width: 100%;
    margin-bottom: 23px;
}

.form-field > label,
.password-label label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 750;
    color: var(--text);
}

.password-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* =========================================================
   INPUT
   ========================================================= */

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 53px;

    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 118, 46, 0.12);
}

.input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #9ba5b5;
    font-size: 15px;
    pointer-events: none;
}

.input-wrapper .form-control {
    width: 100%;
    min-width: 0;
    min-height: 51px;
    padding: 12px 44px 12px 46px;

    border: 0;
    outline: 0;
    border-radius: inherit;
    box-shadow: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
}

.input-wrapper .form-control:focus {
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
}

.input-wrapper .form-control::placeholder {
    color: #a0a8b6;
    opacity: 1;
}

/* =========================================================
   TOGGLE PASSWORD
   ========================================================= */

.password-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 34px;
    padding: 0;

    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8b96a8;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--orange-dark);
    background: var(--orange-light);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* =========================================================
   OPSI LOGIN
   ========================================================= */

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 2px 0 25px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.remember-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--orange);
    cursor: pointer;
}

.forgot-link {
    color: var(--orange-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.forgot-link:hover {
    color: #bd4610;
}

/* =========================================================
   TOMBOL LOGIN
   ========================================================= */

.btn-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    min-height: 53px;
    padding: 14px 19px;

    border: 1px solid transparent;
    border-radius: 12px;
    background: linear-gradient(
        100deg,
        var(--orange) 0%,
        #ff873f 100%
    );

    color: var(--white);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 9px 20px rgba(255, 118, 46, 0.19);
    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.btn-login > span {
    min-width: 0;
    text-align: left;
}

.btn-login > i {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255, 118, 46, 0.27);
}

.btn-login:hover:not(:disabled) > i {
    transform: translateX(3px);
}

.btn-login:focus-visible {
    outline: 3px solid rgba(255, 118, 46, 0.35);
    outline-offset: 3px;
}

.btn-login:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* =========================================================
   CATATAN KEAMANAN
   ========================================================= */

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 25px;
    padding: 15px;

    border: 1px solid #eceef2;
    border-radius: 12px;
    background: #f7f8fa;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.security-note > i {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--orange);
    font-size: 15px;
}

/* =========================================================
   KEMBALI KE WEBSITE
   ========================================================= */

.back-home {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;

    width: fit-content;
    max-width: 100%;
    margin: 28px auto 0;

    color: #687589;
    font-size: 12px;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.back-home:hover {
    color: var(--orange-dark);
}

.back-home i {
    flex-shrink: 0;
}

/* =========================================================
   FOOTER MOBILE
   ========================================================= */

.mobile-footer {
    display: none;
}

/* =========================================================
   LAPTOP KECIL
   ========================================================= */

@media (max-width: 1100px) and (min-width: 768px) {
    .login-page {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    }

    .visual-content {
        padding: 40px 32px;
    }

    .visual-message h1 {
        font-size: clamp(32px, 4vw, 46px);
    }

    .visual-features {
        gap: 16px;
    }

    .login-form-section {
        padding-right: 35px;
        padding-left: 35px;
    }
}

/* =========================================================
   MOBILE DAN TABLET KECIL
   PENTING: HANYA SATU LOGO YANG DITAMPILKAN
   ========================================================= */

@media (max-width: 767.98px) {
    body {
        background: var(--white);
    }

    .login-page {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
    }

    /* Header visual */
    .login-visual {
        display: flex;
        flex: 0 0 auto;
        width: 100%;
        min-height: 170px;
        height: auto;
        background-position: center 42%;
    }

    .visual-overlay {
        background: linear-gradient(
            110deg,
            rgba(100, 43, 20, 0.91),
            rgba(201, 88, 37, 0.79)
        );
    }

    .visual-content {
        justify-content: center;
        min-height: 170px;
        padding: 24px 20px;
    }

    .visual-message {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
    }

    .eyebrow {
        gap: 8px;
        margin-bottom: 12px;
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .eyebrow-line {
        width: 20px;
        height: 2px;
    }

    .visual-message h1 {
        margin-bottom: 8px;
        font-size: clamp(23px, 6vw, 32px);
        line-height: 1.13;
        letter-spacing: -0.6px;
    }

    .visual-message h1 span {
        display: inline;
    }

    .visual-message p {
        max-width: 440px;
        font-size: 11px;
        line-height: 1.65;
    }

    .visual-features,
    .visual-footer {
        display: none;
    }

    /* Panel form */
    .login-form-section {
        display: flex;
        flex: 1 0 auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;

        width: 100%;
        min-height: 0;
        padding: 25px 22px 28px;
        background: var(--white);
    }

    /* Sembunyikan logo desktop sepenuhnya */
    .desktop-brand,
    .login-heading .login-icon {
        display: none !important;
    }

    /* Tampilkan satu logo mobile */
    .mobile-brand {
        display: flex !important;
        flex: 0 0 auto;
        justify-content: center;
        align-items: center;

        width: 100%;
        margin: 0 auto 28px;
    }

    .mobile-brand a {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .mobile-brand img {
        display: block;
        width: 100%;
        max-width: 280px;
        max-height: 72px;
        height: auto;
        object-fit: contain;
        object-position: center;
    }

    .login-form-wrapper {
        flex: 0 0 auto;
        width: 100%;
        max-width: 430px;
        margin: 0 auto;
    }

    .login-heading {
        margin-bottom: 25px;
        text-align: left;
    }

    .login-heading h2 {
        margin-bottom: 8px;
        font-size: clamp(22px, 5.8vw, 27px);
        line-height: 1.3;
        letter-spacing: -0.6px;
    }

    .login-heading p {
        font-size: 12px;
        line-height: 1.65;
    }

    .form-field {
        margin-bottom: 20px;
    }

    .form-field > label,
    .password-label label {
        margin-bottom: 8px;
        font-size: 12px;
    }

    .input-wrapper {
        min-height: 49px;
        border-radius: 11px;
    }

    .input-wrapper .form-control {
        min-height: 47px;
        padding-left: 43px;
        font-size: 12px;
    }

    .input-icon {
        left: 14px;
        font-size: 14px;
    }

    .password-toggle {
        right: 9px;
    }

    .login-options {
        gap: 10px;
        margin-bottom: 22px;
    }

    .remember-option,
    .forgot-link {
        font-size: 11px;
    }

    .btn-login {
        min-height: 50px;
        padding: 13px 16px;
        border-radius: 11px;
        font-size: 12px;
    }

    .security-note {
        gap: 10px;
        margin-top: 20px;
        padding: 12px;
        font-size: 10px;
    }

    .back-home {
        margin-top: 24px;
        font-size: 11px;
    }

    .mobile-footer {
        display: block;
        width: 100%;
        margin-top: 28px;
        padding-top: 15px;
        border-top: 1px solid #f0f0f0;

        color: #8a93a1;
        font-size: 10px;
        line-height: 1.6;
        text-align: center;
    }
}

/* =========================================================
   PONSEL SANGAT KECIL
   ========================================================= */

@media (max-width: 380px) {
    .login-visual,
    .visual-content {
        min-height: 155px;
    }

    .visual-content {
        padding: 20px 16px;
    }

    .visual-message h1 {
        font-size: 22px;
    }

    .visual-message p {
        font-size: 10px;
    }

    .login-form-section {
        padding: 22px 17px 24px;
    }

    .mobile-brand {
        margin-bottom: 24px;
    }

    .mobile-brand img {
        max-width: 245px;
        max-height: 65px;
    }

    .login-heading h2 {
        font-size: 22px;
    }

    .login-heading p {
        font-size: 11px;
    }

    .login-options {
        align-items: flex-start;
    }

    .remember-option,
    .forgot-link {
        font-size: 10px;
    }
}

/* =========================================================
   LANDSCAPE MOBILE
   ========================================================= */

@media (max-width: 767.98px) and (orientation: landscape) {
    .login-visual,
    .visual-content {
        min-height: 145px;
    }

    .login-form-section {
        padding-top: 20px;
    }

    .mobile-brand {
        margin-bottom: 20px;
    }
}

/* =========================================================
   AKSESIBILITAS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
