.login-form .agent-entry {
    display: block;
    width: 100%;
    padding: 12px 8px;
    margin-top: 20px;
    border: 1px solid #fd7f23;
    border-radius: 6px;
    background: #fff;
    color: #fd7f23;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.login-form .agent-entry:hover {
    background: #fff5ed;
}

.agent-modal[hidden], .agent-modal [hidden] {
    display: none !important;
}

.agent-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: rgb(0 0 0 / 50%);
}

.agent-dialog {
    width: 440px;
    max-width: 100%;
    max-height: calc(100dvh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 16px 60px rgb(0 0 0 / 22%);
    color: #333333;
    text-align: left;
}

.agent-dialog.agent-dialog-wide {
    width: 740px;
}

.agent-dialog-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 24px 28px 0;
}

.agent-dialog-body {
    padding: 24px 28px 28px;
}

.agent-dialog h2 {
    margin: 0 0 10px;
    color: #2a3860;
    font-size: 24px;
    line-height: 1.3;
}

.agent-dialog .agent-intro {
    margin: 0 0 22px;
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
}

#agent-dialog-title, #agent-dialog-intro {
    text-align: center;
}

.agent-dialog button {
    font: inherit;
}

.agent-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3d3d3d;
    cursor: pointer;
}

.agent-dialog fieldset {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.agent-dialog legend {
    float: none;
    width: 100%;
    padding: 0 0 10px;
    margin: 0 0 14px;
    border-bottom: 1px solid #eeeeee;
    font-size: 15px;
    font-weight: 600;
    color: #2a3860;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.agent-field {
    min-width: 0;
    margin-bottom: 16px;
}

.agent-dialog label {
    display: block;
    margin: 0 0 6px;
    color: #444444;
    font-size: 13px;
    font-weight: 600;
}

.agent-input-wrap {
    position: relative;
}

.agent-dialog input:not([type="hidden"]):not([type="file"]), .agent-dialog textarea {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 44px;
    padding: 11px 12px;
    margin: 0;
    border: 1px solid #dddddd;
    border-radius: 6px;
    background: #fff;
    color: #333333;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.agent-dialog textarea {
    resize: vertical;
}

.agent-dialog input:focus, .agent-dialog textarea:focus {
    outline: 2px solid #ffd9bc;
    outline-offset: 1px;
    border-color: #fd7f23;
}

.agent-dialog #agent-applicant_email[readonly] {
    background: #f1f3f5;
    color: #6b7280;
    border-color: #d7dce2;
    cursor: default;
}

.agent-dialog #agent-applicant_email[readonly]:focus {
    outline-color: #d7dce2;
    border-color: #d7dce2;
    box-shadow: none;
}

.agent-input-wrap input[type="password"], .agent-input-wrap input[data-password-visible] {
    padding-right: 44px !important;
}

.agent-input-wrap input::-ms-reveal {
    display: none;
}

.agent-input-wrap input::-ms-clear {
    display: none;
}

.agent-password-toggle {
    position: absolute;
    right: 5px;
    top: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #666666;
    cursor: pointer;
}

.agent-dialog .agent-hint {
    margin: 0;
    font-size: 12px;
    color: #666666;
    line-height: 1.6;
}

.agent-file-box {
    padding: 16px;
    border: 1px dashed #e6cbb7;
    border-radius: 6px;
    background: #fff9f4;
}

.agent-file-box input {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
    font-size: 13px;
}

.agent-file-box input::file-selector-button {
    padding: 8px 12px;
    margin-right: 10px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    background: #fff;
    color: #fd7f23;
    cursor: pointer;
}

.agent-primary {
    min-height: 44px;
    padding: 11px 18px;
    border: 1px solid #fd7f23;
    border-radius: 6px;
    background: #fd7f23;
    color: #fff;
    font-weight: 600 !important;
    cursor: pointer;
}

#agent-signin-panel > .agent-primary, .agent-success .agent-primary {
    width: 100%;
}

.agent-dialog button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.agent-dialog button:focus-visible {
    outline: 2px solid #fd7f23;
    outline-offset: 3px;
}

.agent-text-button {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: #fd7f23;
    font-size: 13px !important;
    cursor: pointer;
    text-align: left;
}

.agent-text-button:hover {
    text-decoration: underline;
}

.agent-signin-links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 12px;
    margin: -4px 0 18px;
}

.agent-signin-links a {
    margin-inline-start: auto;
}

.agent-member-link {
    display: block;
    margin: 16px auto 0;
    text-align: center;
}

.agent-methods {
    display: flex;
    padding: 4px;
    gap: 4px;
    margin: 0 0 20px;
    border-radius: 7px;
    background: #f1f2f5;
}

.agent-methods button {
    flex: 1;
    min-height: 38px;
    padding: 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #666666;
    cursor: pointer;
}

.agent-methods button.active {
    background: #fff;
    color: #fd7f23;
    box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
}

.agent-email-row {
    display: flex;
    align-items: stretch;
}

.agent-dialog .agent-email-row input {
    flex: 1;
    width: 0;
}

.agent-dialog .agent-email-row.otp-active input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.agent-email-row .agent-otp-send {
    flex: 0 0 auto;
    max-width: 45%;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
}

.agent-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 4px;
}

.agent-dialog .agent-rejection-notice {
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #ecd9a2;
    border-radius: 6px;
    background: #fff8e6;
    color: #654b18;
}

.agent-dialog .agent-rejection-content {
    min-width: 0;
}

.agent-dialog .agent-rejection-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.agent-dialog .agent-rejection-reason {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.agent-dialog .agent-error {
    padding: 12px;
    margin: 0 0 16px;
    border: 1px solid #edc7c7;
    border-radius: 6px;
    background: #fff4f4;
    color: #982c2c;
    font-size: 13px;
    line-height: 1.6;
}

.agent-success {
    text-align: center;
}

.agent-success p {
    margin: 16px 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #555555;
}

.agent-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #e8f5ed;
    color: #28764a;
    font-size: 24px;
}

.agent-dialog:not(.agent-dialog-wide) {
    border-radius: 5px;
}

.agent-dialog:not(.agent-dialog-wide) .agent-dialog-header {
    padding: 24px 40px 0;
}

.agent-dialog:not(.agent-dialog-wide) .agent-dialog-body {
    padding: 24px 40px 40px;
}

.agent-dialog:not(.agent-dialog-wide) h2 {
    font-size: 22px;
}

.agent-dialog #agent-signin-panel input {
    padding: 15px !important;
    font-size: 16px;
}

@media (max-width: 575px) {
    .agent-modal {
        padding: 12px;
    }

    .agent-dialog {
        max-height: calc(100dvh - 24px);
    }

    .agent-dialog-header {
        padding: 24px 18px 0;
    }

    .agent-dialog-body {
        padding: 20px 18px;
    }

    .agent-dialog h2 {
        font-size: 21px;
    }

    .agent-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .agent-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .agent-form-actions > .agent-text-button {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .agent-dialog:not(.agent-dialog-wide) .agent-dialog-header {
        padding-right: 24px;
        padding-left: 24px;
    }

    .agent-dialog:not(.agent-dialog-wide) .agent-dialog-body {
        padding-right: 24px;
        padding-left: 24px;
    }
}
