:root {
    --fm-primary: #004840;
    --fm-accent: #00ae9b;
    --fm-accent-dark: #008f80;
    --fm-soft: #e7f7f7;
    --fm-text: #111827;
    --fm-muted: #6b7280;
    --fm-border: #e5e7eb;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #f8fbfa;
    color: var(--fm-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--fm-accent);
    outline-offset: 3px;
}

/* Brand and help: anchored to viewport, outside the login card */
.img-holder {
    position: absolute;
    top: 20px;
    left: 24px;
    z-index: 20;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.logo {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-support {
    position: absolute;
    top: 23px;
    right: 25px;
    z-index: 20;
}

.login-support a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--fm-border);
    border-radius: 50%;
    background: #fff;
    color: var(--fm-primary);
    text-decoration: none;
    /* box-shadow: 0 3px 12px rgba(0, 72, 64, .07); */
    transition: background .2s ease, transform .2s ease;
}

.login-support a:hover {
    background: var(--fm-soft);
    transform: translateY(-1px);
}

.login-support i {
    color: var(--fm-primary);
    font-size: 19px;
}

.login-support span {
    position: absolute;
    top: -6px;
    right: -11px;
    padding: 3px 6px;
    border-radius: 5px 5px 5px 0;
    background: var(--fm-accent-dark);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .2px;
}

/* Compact fintech card */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 96px 16px 40px;
}

.login-card {
    width: 100%;
    max-width: 410px;
    margin: 0 auto;
    padding: 29px 27px 26px;
    border: 1px solid var(--fm-border);
    border-radius: 18px;
    background: #fff;
    /* box-shadow: 0 8px 26px rgba(0, 72, 64, .055); */
}

.login-content {
    width: 100%;
    min-width: 0;
}

.login-header {
    margin-bottom: 23px;
    text-align: center;
}

.login-header h4 {
    margin: 0 0 7px !important;
    color: var(--fm-primary);
    font-size: 24px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.45px;
}

.login-header p {
    margin: 0 !important;
    color: var(--fm-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Form */
#login-form {
    width: 100%;
}

.login-input-group {
    margin-bottom: 14px;
}

.login-card .form-control,
.login-card .form-control-lg {
    display: block;
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--fm-border);
    border-radius: 11px;
    background: #fff;
    color: var(--fm-text);
    font-size: 14px;
    line-height: normal;
    outline: none;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.login-card .form-control::placeholder {
    color: #98a1ab;
    opacity: 1;
}

.login-card .form-control:focus {
    border-color: var(--fm-accent-dark);
    box-shadow: 0 0 0 3px rgba(0, 174, 155, .11);
}

.login-card .form-control.is-invalid {
    border-color: #dc3545;
}

.login-card .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .10);
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #c62828;
    font-size: 12px;
    line-height: 1.4;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 49px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fm-muted);
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--fm-soft);
    color: var(--fm-primary);
}

.password-toggle i {
    font-size: 16px;
}

.forgot-password-row {
    margin: -1px 0 17px;
    text-align: right;
}

.forgot-password {
    color: var(--fm-accent-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.forgot-password:hover {
    color: var(--fm-primary);
    text-decoration: underline;
}

/* Login action */
.login-card .btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 10px 15px;
    border: 1px solid var(--fm-primary) !important;
    border-radius: 11px;
    background: var(--fm-primary);
    color: #fff !important;
    font-size: 14px;
    font-weight: 750;
    box-shadow: 0 3px 9px rgba(0, 72, 64, .12);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.login-card .btn-submit:hover:not(:disabled) {
    background: #006054;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0, 72, 64, .17);
}

.login-card .btn-submit:disabled {
    opacity: .75;
    cursor: wait;
}

.submit-loader {
    display: none;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fm-login-spin .7s linear infinite;
}

.btn-submit.is-loading .submit-loader {
    display: inline-block;
}

@keyframes fm-login-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alternative sign-in */
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 19px 0 14px;
}

.or-divider span {
    flex: 1;
    height: 1px;
    background: var(--fm-border);
}

.or-divider p {
    margin: 0;
    color: var(--fm-muted);
    font-size: 12px;
    white-space: nowrap;
}

.google-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 46px;
    padding: 9px 13px;
    border: 1px solid var(--fm-border);
    border-radius: 11px;
    background: #fff;
    color: var(--fm-text);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease;
}

.google-login:hover:not(:disabled) {
    background: #f8fbfa;
    border-color: #cbd8d5;
    color: var(--fm-text);
}

.google-login:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.google-icon {
    display: block;
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.register-footer {
    margin-top: 19px;
    text-align: center;
}

.register-footer p {
    margin: 0;
    color: var(--fm-muted);
    font-size: 12px;
    line-height: 1.6;
}

.register-footer a {
    margin-left: 3px;
    color: var(--fm-accent-dark);
    font-weight: 750;
    text-decoration: none;
}

.register-footer a:hover {
    color: var(--fm-primary);
    text-decoration: underline;
}

/* Laravel validation and session alerts */
.login-alert-container,
.login-status-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    width: min(360px, calc(100vw - 32px));
}

.login-alert,
.login-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 13px;
    border: 1px solid var(--fm-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .09);
}

.login-alert {
    border-left: 3px solid #dc3545;
}

.login-status {
    border-left: 3px solid #16a34a;
}

.login-alert-icon,
.login-status-icon {
    flex-shrink: 0;
    font-size: 17px;
}

.login-alert-icon {
    color: #dc3545;
}

.login-status-icon {
    color: #16a34a;
}

.login-alert-content,
.login-status-content {
    flex: 1;
    min-width: 0;
}

.login-alert-content strong,
.login-status-content strong {
    display: block;
    margin-bottom: 3px;
    color: var(--fm-text);
    font-size: 12px;
    font-weight: 750;
}

.login-alert-content p,
.login-status-content p {
    margin: 0;
    color: var(--fm-muted);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.login-alert-close,
.login-status-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--fm-muted);
    cursor: pointer;
}

.login-alert-close:hover,
.login-status-close:hover {
    background: var(--fm-soft);
    color: var(--fm-primary);
}

/* Tablet and mobile */
@media (max-width: 576px) {
    .login-page {
        align-items: flex-start;
        padding: 116px 14px 32px;
    }

    .login-card {
        max-width: 410px;
        padding: 25px 19px 23px;
        border-radius: 16px;
    }

    .img-holder {
        top: 17px;
        left: 17px;
        width: 48px;
        height: 48px;
    }

    .logo {
        width: 45px;
        height: 45px;
    }

    .login-support {
        top: 19px;
        right: 18px;
    }

    .login-support a {
        width: 42px;
        height: 42px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-header h4 {
        font-size: 23px;
    }

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

    .login-card .form-control,
    .login-card .form-control-lg {
        font-size: 16px;
    }

    .login-alert-container,
    .login-status-container {
        top: 13px;
        left: 13px;
        right: 13px;
        width: auto;
    }
}

@media (max-width: 360px) {
    .login-page {
        padding: 102px 10px 25px;
    }

    .login-card {
        padding: 22px 15px;
    }

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

    .img-holder {
        left: 12px;
    }

    .login-support {
        right: 13px;
    }
}

@media (max-height: 680px) and (min-width: 577px) {
    .login-page {
        align-items: flex-start;
        padding-top: 90px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
    }

    .submit-loader {
        animation-duration: 1.5s;
    }
}


/* =========================================================
   FETCHMONIE - FORGOT PASSWORD
========================================================= */

.forgot-password-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    width: 100%;
    margin: -5px 0 18px;
}

.forgot-password {
    color: #004840;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    transition: color .2s ease;
}

.forgot-password:hover {
    color: #008f80;
    text-decoration: underline;
}

.forgot-password:focus-visible {
    outline: 2px solid #00ae9b;
    outline-offset: 3px;
    border-radius: 3px;
}


/* GOOGLE LOGIN */
.login-card .google-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-height: 48px;
    padding: 10px 16px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 11px;

    color: #111827;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.login-card .google-login:hover {
    background: #e7f7f7;
    border-color: #00ae9b;
    color: #004840;
}

.login-card .google-icon {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    object-fit: contain;
    opacity: 1 !important;
    visibility: visible !important;
}
