/* ============================================================
   FUNDER LOGIN + REGISTER — NFA
   File: assets/css/funder.css
   ============================================================ */

/* ─── Shared: Topbar ─── */
.funder-login-topbar,
.funder-reg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background-color: #ffffff;
    border-bottom: 1px solid #e8eaed;
}

.funder-login-topbar__back,
.funder-reg-topbar__back {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #555555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.funder-login-topbar__back:hover,
.funder-reg-topbar__back:hover {
    color: #0a1f3c;
}

/* ─── Shared: Button states ─── */
.funder-login-form__submit.is-loading .btn-text,
.funder-reg-footer__submit.is-loading .btn-text {
    display: none;
}

.funder-login-form__submit .btn-loader,
.funder-reg-footer__submit .btn-loader {
    display: none;
}

.funder-login-form__submit.is-loading .btn-loader,
.funder-reg-footer__submit.is-loading .btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-loader svg {
    animation: nfa-spin 0.8s linear infinite;
}

@keyframes nfa-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ─── Shared: Error / success states ─── */
.funder-login-form__group.has-error .funder-login-form__input,
.funder-reg-field.has-error .funder-reg-field__input,
.funder-reg-field.has-error .funder-reg-field__select {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

.funder-login-form__group.has-success .funder-login-form__input,
.funder-reg-field.has-success .funder-reg-field__input,
.funder-reg-field.has-success .funder-reg-field__select {
    border-color: #38a169 !important;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.08) !important;
}

.funder-reg-section.has-error {
    outline: 2px solid #e53e3e;
    outline-offset: -2px;
}

/* ─── Server messages ─── */
.funder-login-server-msg,
.funder-reg-server-msg {
    display: none;
    padding: 12px 16px;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.funder-login-server-msg.msg--error,
.funder-reg-server-msg.msg--error {
    display: block;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.funder-login-server-msg.msg--success,
.funder-reg-server-msg.msg--success {
    display: block;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.funder-login-server-msg a,
.funder-reg-server-msg a {
    color: inherit;
    font-weight: 600;
}

/* ─── Required star ─── */
.req {
    color: #e53e3e;
}

/* ================================================================
   LOGIN PAGE
================================================================ */
.funder-login-page {
    min-height: 100vh;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
}

.funder-login-topbar__btn {
    display: inline-block;
    height: 38px;
    line-height: 38px;
    padding: 0 20px;
    background-color: #e5581e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.funder-login-topbar__btn:hover {
    background-color: #c94c18;
    color: #ffffff;
}

.funder-login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.funder-login-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 40px 36px 36px;
    width: 100%;
    max-width: 420px;
}

.funder-login-card__title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin: 0 0 10px;
    line-height: 1.2;
}

.funder-login-card__subtitle {
    font-size: 13px;
    color: #777777;
    text-align: center;
    line-height: 1.6;
    margin: 0 0 28px;
}

.funder-login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.funder-login-form__group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.funder-login-form__label {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 6px;
}

.funder-login-form__input {
    height: 42px;
    border: 1.5px solid #dde2ea;
    border-radius: 5px;
    padding: 0 42px 0 12px;
    font-size: 14px;
    color: #333333;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    width: 100%;
}

.funder-login-form__input::placeholder {
    color: #aaaaaa;
}

.funder-login-form__input:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26, 58, 107, 0.1);
}

.funder-login-form__error {
    font-size: 12px;
    color: #e53e3e;
    margin-top: 5px;
    min-height: 16px;
    display: block;
}

/* Input wrap (password eye) */
.funder-login-form__input-wrap {
    position: relative;
}

.funder-login-form__eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.funder-login-form__eye .eye-closed {
    display: none;
}

.funder-login-form__submit {
    width: 100%;
    height: 46px;
    background-color: #1a3a6b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
    margin-top: 4px;
}

.funder-login-form__submit:hover:not(:disabled) {
    background-color: #0e2550;
}

.funder-login-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.funder-login-form__register {
    text-align: center;
    font-size: 13px;
    color: #666666;
    margin: 18px 0 0;
}

.funder-login-form__register a {
    color: #1a3a6b;
    font-weight: 600;
    text-decoration: none;
}

.funder-login-form__register a:hover {
    text-decoration: underline;
}

/* ================================================================
   REGISTER PAGE
================================================================ */
.funder-reg-page {
    min-height: 100vh;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
}

.funder-reg-topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666666;
}

.funder-reg-topbar__login {
    font-size: 13px;
    font-weight: 600;
    color: #1a3a6b;
    text-decoration: none;
    padding: 6px 16px;
    border: 1.5px solid #1a3a6b;
    border-radius: 4px;
    transition: all 0.2s;
}

.funder-reg-topbar__login:hover {
    background: #1a3a6b;
    color: #ffffff;
}

.funder-reg-main {
    flex: 1;
    padding: 40px 20px 60px;
    display: flex;
    justify-content: center;
}

.funder-reg-wrap {
    background: #ffffff;
    border-radius: 8px;
    padding: 40px 48px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.funder-reg-wrap__title {
    font-size: 26px;
    font-weight: 700;
    color: #1a3a6b;
    margin: 0 0 8px;
}

.funder-reg-wrap__stage {
    font-size: 13px;
    color: #555555;
    margin: 0 0 4px;
}

.funder-reg-wrap__note {
    font-size: 13px;
    color: #888888;
    margin: 0 0 30px;
}

/* Section */
.funder-reg-section {
    background: #f7f8fa;
    border-radius: 6px;
    padding: 24px 28px;
    margin-bottom: 20px;
}

.funder-reg-section--terms {
    background: #f7f8fa;
}

.funder-reg-section__title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 0 0 14px;
}

.funder-reg-section__note {
    font-size: 12px;
    color: #888888;
    margin: -8px 0 14px;
}

/* Row */
.funder-reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.funder-reg-row:last-child {
    margin-bottom: 0;
}

/* Field */
.funder-reg-field {
    display: flex;
    flex-direction: column;
}

.funder-reg-field__label {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 6px;
}

.funder-reg-field__input,
.funder-reg-field__select {
    height: 40px;
    border: 1.5px solid #dde2ea;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 13.5px;
    color: #333333;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    width: 100%;
}

.funder-reg-field__input:focus,
.funder-reg-field__select:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26, 58, 107, 0.1);
}

.funder-reg-field__error {
    font-size: 12px;
    color: #e53e3e;
    margin-top: 4px;
    min-height: 16px;
    display: block;
}

/* Select wrapper */
.funder-reg-field__select-wrap {
    position: relative;
}

.funder-reg-field__select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #888888;
    pointer-events: none;
}

.funder-reg-field__select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 32px;
}

/* File upload */
.funder-reg-field__upload-wrap {
    position: relative;
}

.funder-reg-field__file {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
    z-index: 2;
}

.funder-reg-field__upload-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    border: 1.5px solid #dde2ea;
    border-radius: 4px;
    padding: 0 12px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.funder-reg-field__upload-label:hover {
    border-color: #1a3a6b;
}

.upload-placeholder {
    font-size: 12.5px;
    color: #aaaaaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checkbox grids */
.funder-reg-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 16px;
}

.funder-reg-checkbox-grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

.funder-reg-checkbox-grid--1col {
    grid-template-columns: 1fr;
}

.funder-reg-checkbox-grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

.funder-reg-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #333333;
}

.funder-reg-checkbox input[type="checkbox"] {
    display: none;
}

.funder-reg-checkbox__box {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1.5px solid #b0bac8;
    border-radius: 3px;
    background: #ffffff;
    transition: all 0.15s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.funder-reg-checkbox input[type="checkbox"]:checked+.funder-reg-checkbox__box {
    background: #1a3a6b;
    border-color: #1a3a6b;
}

.funder-reg-checkbox input[type="checkbox"]:checked+.funder-reg-checkbox__box::after {
    content: '';
    display: block;
    width: 9px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg) translateY(-1px);
}

.funder-reg-checkbox__label {
    line-height: 1.3;
}

/* Terms checkbox */
.funder-reg-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.funder-reg-terms input[type="checkbox"] {
    display: none;
}

.funder-reg-terms__box {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1.5px solid #b0bac8;
    border-radius: 3px;
    background: #ffffff;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    position: relative;
}

.funder-reg-terms input[type="checkbox"]:checked+.funder-reg-terms__box {
    background: #1a3a6b;
    border-color: #1a3a6b;
}

.funder-reg-terms input[type="checkbox"]:checked+.funder-reg-terms__box::after {
    content: '';
    display: block;
    width: 9px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg) translateY(-1px);
}

.funder-reg-terms__text {
    font-size: 13px;
    color: #444444;
    line-height: 1.5;
}

/* Footer */
.funder-reg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.funder-reg-footer__login {
    font-size: 13px;
    color: #666666;
    margin: 0;
}

.funder-reg-footer__login a {
    color: #1a3a6b;
    font-weight: 600;
    text-decoration: none;
}

.funder-reg-footer__login a:hover {
    text-decoration: underline;
}

.funder-reg-footer__submit {
    height: 44px;
    padding: 0 32px;
    background: #1a3a6b;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.funder-reg-footer__submit:hover:not(:disabled) {
    background: #0e2550;
}

.funder-reg-footer__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
    .funder-reg-wrap {
        padding: 24px 16px;
    }

    .funder-reg-row {
        grid-template-columns: 1fr;
    }

    .funder-reg-checkbox-grid,
    .funder-reg-checkbox-grid--3col {
        grid-template-columns: 1fr 1fr;
    }

    .funder-reg-checkbox-grid--2col {
        grid-template-columns: 1fr;
    }

    .funder-reg-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .funder-reg-footer__submit {
        width: 100%;
        justify-content: center;
    }

    .funder-login-card {
        padding: 30px 20px 24px;
    }

    .funder-reg-topbar,
    .funder-login-topbar {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {

    .funder-reg-checkbox-grid,
    .funder-reg-checkbox-grid--3col {
        grid-template-columns: 1fr;
    }

    .funder-reg-topbar__right span {
        display: none;
    }
}